
/**
 * astro: astronomical functions, utilities and data
 * <br>Copyright 2009 Ian Cameron Smith
 * 
 * <p>References:
 * <dl>
 * <dt>PAC</dt>
 * <dd>"Practical Astronomy with your Calculator", by Peter Duffett-Smith,
 * ISBN-10: 0521356997.</dd>
 * <dt>ESAA</dt>
 * <dd>"Explanatory Supplement to the Astronomical Almanac", edited
 * by Kenneth Seidelmann, ISBN-13: 978-1-891389-45-0.</dd>
 * <dt>AA</dt>
 * <dd>"Astronomical Algorithms", by Jean Meeus, ISBN-10: 0-943396-61-1.</dd>
 * </dl>
 * The primary reference for this version of the software is AA.
 * 
 * <p>Note that the formulae have been converted to work in radians, to
 * make it easier to work with java.lang.Math.
 *
 * <p>This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2
 * as published by the Free Software Foundation (see COPYING).
 * 
 * <p>This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */


package org.hermit.astro;

import static java.lang.Math.cos;


/**
 * This class contains the tables of periodic terms from the VSOP87
 * planetary theory.  It also contains a simple method to calculate the
 * value of any series for any moment in time.
 * 
 * <p>Each instance of this class embodies the data tables for one planet.
 */
class Vsop87 {

	// ******************************************************************** //
	// Mercury.
	// ******************************************************************** //

	// Heliocentric ecliptical longitude.
	private static final double[][][] MERCURY_L = {
		{ 
			{ 440250710, 0.0,        0.0 },
			{ 40989415,  1.48302034, 26087.90314157 },
			{ 5046294,   4.47785449, 52175.8062831 },
			{ 855347,    1.165203,   78263.709425 },
			{ 165590,    4.119692,   104351.612566 },
			{ 34562,     0.77931,    130439.51571 },
			{ 7583,      3.7135,     156527.4188 },
			{ 3560,      1.5120,     1109.3786 },
			{ 1803,      4.1033,     5661.3320 },
			{ 1726,      0.3583,     182615.3220 },
			{ 1590,      2.9951,     25028.5212 },
			{ 1365,      4.5992,     27197.2817 },
			{ 1017,      0.8803,     31749.2352 },
			{ 714,       1.541,      24978.525 }, 
			{ 644,       5.303,      21535.950 },
			{ 451,       6.050,      51116.424 },
			{ 404,       3.282,      208703.225 },
			{ 352,       5.242,      20426.571 },
			{ 345,       2.792,      15874.618 },
			{ 343,       5.765,      955.600 },
			{ 339,       5.863,      25558.212 },
			{ 325,       1.337,      53285.185 },
			{ 273,       2.495,      529.691 },
			{ 264,       3.917,      57837.138 },
			{ 260,       0.987,      4551.953 },
			{ 239,       0.113,      1059.382 },
			{ 235,       0.267,      11322.664 },
			{ 217,       0.660,      13521.751 },
			{ 209,       2.092,      47623.853 },
			{ 183,       2.629,      27043.503 },
			{ 182,       2.434,      25661.305 },
			{ 176,       4.536,      51066.428 },
			{ 173,       2.452,      24498.830 },
			{ 142,       3.360,      37410.567 },
			{ 138,       0.291,      10213.286 },
			{ 125,       3.721,      39609.655 },
			{ 118,       2.781,      77204.327 },
			{ 106,       4.206,      19804.827 }
		},
		{ 
			{ 2608814706223.0, 0,         0 },
			{ 1126008,         6.2170397, 26087.9031416 },
			{ 303471,          3.055655,  52175.806283 },
			{ 80538,           6.10455,   78263.70942 },
			{ 21245,           2.83532,   104351.61257 },
			{ 5592,            5.8268,    130439.5157 },
			{ 1472,            2.5185,    156527.4188 },
			{ 388,             5.480,     182615.322 },
			{ 352,             3.052,     1109.379 },
			{ 103,             2.149,     208703.225 },
			{ 94,              6.12,      27197.28 },
			{ 91,              0.00,      24978.52 },
			{ 52,              5.62,      5661.33 },
			{ 44,              4.57,      25028.52 },
			{ 28,              3.04,      51066.43 },
			{ 27,              5.09,      234791.13 }
		},
		{ 
			{ 53050, 0,       0 },
			{ 16904, 4.69072, 26087.90314 },
			{ 7397,  1.3474,  52175.8063 },
			{ 3018,  4.4564,  78263.7094 },
			{ 1107,  1.264,   104351.6126 },
			{ 378,   4.320,   130439.516 },
			{ 123,   1.069,   156527.419 },
			{ 39,    4.08,    182615.32 },
			{ 15,    4.63,    1109.38 },
			{ 12,    0.79,    208703.23 }
		},
		{ 
			{ 188, 0.035, 52175.806 },
			{ 142, 3.125, 26087.903 },
			{ 97,  3.00,  78263.71 },
			{ 44,  6.02,  104351.61 }, 
			{ 35,  0,     0 },
			{ 18,  2.78,  130439.52 },
			{ 7,   5.82,  156527.42 },
			{ 3,   2.57,  182615.32 }
		},
		{ 
			{ 114, 3.1416, 0 },
			{ 2,   2.03,   26087.90 },
			{ 2,   1.42,   78263.71 },
			{ 2,   4.50,   52175.81 },
			{ 1,   4.50,   104351.61 },
			{ 1,   1.27,   130439.52 }
		},
		{ 
			{ 1, 3.14, 0 }
		}
	};


	// Heliocentric latitude.
	private static final double[][][] MERCURY_B = {
		{ 
			{ 11737529, 1.98357499, 26087.90314157 },
			{ 2388077,  5.0373896,  52175.8062831 },
			{ 1222840,  3.1415927,  0 },
			{ 543252,   1.796444,   78263.709425 },
			{ 129779,   4.832325,   104351.612566 },
			{ 31867,    1.58088,    130439.51571 },
			{ 7963,     4.6097,     156527.4188 },
			{ 2014,     1.3532,     182615.3220 },
			{ 514,      4.378,      208703.325 },
			{ 209,      2.020,      24978.525 },
			{ 208,      4.918,      27197.282 },
			{ 132,      1.119,      234791.128 },
			{ 121,      1.813,      53285.185 },
			{ 100,      5.657,      20426.571 }
		},
		{ 
			{ 429151, 3.501698, 26087.903142 },
			{ 146234, 3.141593, 0 },
			{ 22675,  0.01515,  52175.80628 },
			{ 10895,  0.48540,  78263.70942 },
			{ 6353,   3.4294,   104351.6126 },
			{ 2496,   0.1605,   130439.5157 },
			{ 860,    3.185,    156527.419 },
			{ 278,    6.210,    182615.322 },
			{ 86,     2.95,     208703.23 },
			{ 28,     0.29,     27197.28 },
			{ 26,     5.98,     234791.13 }
		},
		{ 
			{ 11831, 4.79066, 26087.90314 },
			{ 1914,  0,       0 },
			{ 1045,  1.2122,  52175.8063 },
			{ 266,   4.434,   78263.709 },
			{ 170,   1.623,   104351.613 },
			{ 96,    4.80,    130439.52 },
			{ 45,    1.61,    156527.42 },
			{ 18,    4.67,    182615.32 },
			{ 7,     1.43,    208703.23 }
		},
		{ 
			{ 235, 0.354, 26087.903 },
			{ 161, 0,     0 },
			{ 19,  4.36,  52175.81 },
			{ 6,   2.51,  78263.71 },
			{ 5,   6.14,  104351.61 },
			{ 3,   3.12,  130439.52 }, 
			{ 2,   6.27,  156527.42 }
		},
		{ 
			{ 4, 1.75, 26087.90 },
			{ 1, 3.14, 0 }
		}
	};


	// Heliocentric radius vector.
	private static final double[][][] MERCURY_R = {
		{ 
			{ 39528272, 0,         0 },
			{ 7834132,  6.1923372, 26087.9031416 },
			{ 795526,   2.959897,  52175.806283 },
			{ 121282,   6.010642,  78263.709425 },
			{ 21922,    2.77820,   104351.61257 },
			{ 4354,     5.8289,    130439.5157 },
			{ 918,      2.597,     156527.419 },
			{ 290,      1.424,     25028.521 },
			{ 260,      3.028,     27197.282 },
			{ 202,      5.647,     182615.322 },
			{ 201,      5.592,     31749.235 },
			{ 142,      6.253,     24978.525 },
			{ 100,      3.734,     21535.950 }
		},
		{ 
			{ 217348, 4.656172, 26087.903142 },
			{ 44142,  1.42386,  52175.80628 },
			{ 10094,  4.47466,  78263.70942 },
			{ 2433,   1.2423,   104351.6126 },
			{ 1624,   0,        0 },
			{ 604,    4.293,    130439.516 },
			{ 153,    1.061,    156527.419 },
			{ 39,     4.11,     182615.32 }
		},
		{ 
			{ 3118, 3.0823, 26087.9031 },
			{ 1245, 6.1518, 52175.8063 },
			{ 425,  2.926,  78263.709 },
			{ 136,  5.980,  104351.613 },
			{ 42,   2.75,   130439.52 },
			{ 22,   3.14,   0 },
			{ 13,   5.80,   156527.42 }
		},
		{ 
			{ 33, 1.68, 26087.90 },
			{ 24, 4.63, 52175.81 },
			{ 12, 1.39, 78263.71 },
			{ 5,  4.44, 104351.61 },
			{ 2,  1.21, 130439.52 }
		}
	};

	/**
	 * Tables of Vsop87 terms for Mercury.
	 */
	static Vsop87 MERCURY = new Vsop87(MERCURY_L, MERCURY_B, MERCURY_R);


	// ******************************************************************** //
	// Venus.
	// ******************************************************************** //

	// Heliocentric ecliptical longitude.
	private static final double[][][] VENUS_L = {
		{ 
			{ 317614667, 0,         0 },
			{ 1353968,   5.5931332, 10213.2855462 },
			{ 89892,     5.30650,   20426.57109 },
			{ 5477,      4.4163,    7860.4194 },
			{ 3456,      2.6996,    11790.6291 },
			{ 2372,      2.9938,    3930.2097 },
			{ 1664,      4.2502,    1577.3435 },
			{ 1438,      4.1575,    9683.5946 },
			{ 1317,      5.1867,    26.2983 },
			{ 1201,      6.1536,    30639.8566 },
			{ 769,       0.816,     9437.763 },
			{ 761,       1.950,     529.691 },
			{ 708,       1.065,     775.523 },
			{ 585,       3.998,     191.448 },
			{ 500,       4.123,     15720.839 },
			{ 429,       3.586,     19367.189 },
			{ 327,       5.677,     5507.553 },
			{ 326,       4.591,     10404.734 },
			{ 232,       3.163,     9153.904 },
			{ 180,       4.653,     1109.379 },
			{ 155,       5.570,     19651.048 },
			{ 128,       4.226,     20.775 },
			{ 128,       0.962,     5661.332 },
			{ 106,       1.537,     801.821 }
		},
		{ 
			{ 1021352943053.0, 0,       0 },
			{ 95708,           2.46424, 10213.28555 },
			{ 14445,           0.51625, 20426.57109 },
			{ 213,             1.795,   30639.857 },
			{ 174,             2.655,   26.298 },
			{ 152,             6.106,   1577.344 },
			{ 82,              5.70,    191.45 },
			{ 70,              2.68,    9437.76 },  
			{ 52,              3.60,    775.52 },   
			{ 38,              1.03,    529.69 },
			{ 30,              1.25,    5507.55 },
			{ 25,              6.11,    10404.73 }
		},
		{ 
			{ 54127, 0,      0 },
			{ 3891,  0.3451, 10213.2855 },
			{ 1338,  2.0201, 20426.5711 },
			{ 24,    2.05,   26.30 },
			{ 19,    3.54,   30639.86 },
			{ 10,    3.97,   775.52 },
			{ 7,     1.52,   1577.34 },
			{ 6,     1.00,   191.45 }
		},
		{ 
			{ 136, 4.804, 10213.286 },
			{ 78,  3.67,  20426.57},
			{ 26,  0,     0 }
		},
		{ 
			{ 114, 3.1416, 0 },
			{ 3,   5.21,   20426.57 },
			{ 2,   2.51,   10213.29 }
		},
		{ 
			{ 1, 3.14, 0 },
		}
	};


	// Heliocentric latitude.
	private static final double[][][] VENUS_B = {
		{ 
			{ 5923638, 0.2670278, 10213.2855462 },
			{ 40108,   1.14737,   20426.57109 },
			{ 32815,   3.14737,   0 },
			{ 1011,    1.0895,    30639.8566 },
			{ 149,     6.254,     18073.705 },
			{ 138,     0.860,     1577.344 },
			{ 130,     3.672,     9437.763 },
			{ 120,     3.705,     2352.866 },
			{ 108,     4.539,     22003.915 }
		},
		{ 
			{ 513348, 1.803643, 10213.285546 },
			{ 4380,   3.3862,   20426.5711 }, 
			{ 199,    0,        0 },
			{ 197,    2.530,    30639.857 }
		},
		{ 
			{ 22378, 3.38509, 10213.28555 },
			{ 282,   0,       0 },
			{ 173,   5.256,   20426.571 },
			{ 27,    3.87,    30639.86 }
		},
		{ 
			{ 647, 4.992, 10213.286 },
			{ 20,  3.14,  0 },
			{ 6,   0.77,  20426.57 },
			{ 3,   5.44,  30639.86 }
		},
		{ 
			{ 14, 0.32, 10213.29 }
		}
	};


	// Heliocentric radius vector.
	private static final double[][][] VENUS_R = {
		{ 
			{ 72334821, 0,        0 },
			{ 489824,   4.021518, 10213.285546 },
			{ 1658,     4.9021,   20426.5711 },
			{ 1632,     2.8455,   7860.4194 },
			{ 1378,     1.1285,   11790.6291 },
			{ 498,      2.587,    9683.595 },
			{ 374,      1.423,    3930.210 },
			{ 264,      5.529,    9437.763 },
			{ 237,      2.551,    15720.839 },
			{ 222,      2.013,    19367.189 },
			{ 126,      2.728,    1577.344 },
			{ 119,      3.020,    10404.734 }
		},
		{ 
			{ 34551, 0.89199, 10213.28555 },
			{ 234,   1.772,   20426.571 },
			{ 234,   3.142,   0 }  
		},
		{ 
			{ 1407, 5.0637, 10213.2855 },
			{ 16,   5.47,   20426.57 },
			{ 13,   0,      0 }  
		},
		{ 
			{ 50, 3.22, 10213.29 }
		},
		{ 
			{ 1, 0.92, 10213.29 }
		}
	};

	/**
	 * Tables of Vsop87 terms for Venus.
	 */
	static Vsop87 VENUS = new Vsop87(VENUS_L, VENUS_B, VENUS_R);


	// ******************************************************************** //
	// Earth.
	// ******************************************************************** //

	// Heliocentric ecliptical longitude.
	private static final double[][][] EARTH_L = {
		{ 
			{ 175347046, 0,         0 },
			{ 3341656,   4.6692568, 6283.0758500 },
			{ 34894,     4.62610,   12566.15170 },
			{ 3497,      2.7441,    5753.3849 },
			{ 3418,      2.8289,    3.5231 },
			{ 3136,      3.6277,    77713.7715 },
			{ 2676,      4.4181,    7860.4194 },
			{ 2343,      6.1352,    3930.2097 },
			{ 1324,      0.7425,    11506.7698 },
			{ 1273,      2.0371,    529.6910 },
			{ 1199,      1.1096,    1577.3435 },
			{ 990,       5.233,     5884.927 },
			{ 902,       2.045,     26.298 },
			{ 857,       3.508,     398.149 },
			{ 780,       1.179,     5223.694 },
			{ 753,       2.533,     5507.553 },
			{ 505,       4.583,     18849.228 },
			{ 492,       4.205,     775.523 },
			{ 357,       2.920,     0.067 },
			{ 317,       5.849,     11790.629 },
			{ 284,       1.899,     796.288 },
			{ 271,       0.315,     10977.079 },
			{ 243,       0.345,     5486.778 },
			{ 206,       4.806,     2544.314 },
			{ 205,       1.869,     5573.143 },
			{ 202,       2.458,     6069.777 },
			{ 156,       0.833,     213.299 },
			{ 132,       3.411,     2942.463 },
			{ 126,       1.083,     20.775 },
			{ 115,       0.645,     0.980 },
			{ 103,       0.636,     4694.003 },
			{ 102,       0.976,     15720.839 },
			{ 102,       4.267,     7.114 },
			{ 99,        6.21,      2146.17 },
			{ 98,        0.68,      155.42 },
			{ 86,        5.98,      161000.69 },
			{ 85,        1.30,      6275.96 },
			{ 85,        3.67,      71430.70 },
			{ 80,        1.81,      17260.15 },
			{ 79,        3.04,      12036.46 },
			{ 75,        1.76,      5088.63 },
			{ 74,        3.50,      3154.69 },
			{ 74,        4.68,      801.82 },
			{ 70,        0.83,      9437.76 },
			{ 62,        3.98,      8827.39 },
			{ 61,        1.82,      7084.90 },
			{ 57,        2.78,      6286.60 },
			{ 56,        4.39,      14143.50 },
			{ 56,        3.47,      6279.55 },
			{ 52,        0.19,      12139.55 },
			{ 52,        1.33,      1748.02 },
			{ 51,        0.28,      5856.48 },
			{ 49,        0.49,      1194.45 },
			{ 41,        5.37,      8429.24 },
			{ 41,        2.40,      19651.05 },
			{ 39,        6.17,      10447.39 },
			{ 37,        6.04,      10213.29 },
			{ 37,        2.57,      1059.38 },
			{ 36,        1.71,      2352.87 },
			{ 36,        1.78,      6812.77 },
			{ 33,        0.59,      17789.85 },
			{ 30,        0.44,      83996.85 },
			{ 30,        2.74,      1349.87 },
			{ 25,        3.16,      4690.48 }
		},
		{ 
			{ 628331966747.0, 0,          0 },
			{ 206059,         2.678235,   6283.075850 },
			{ 4303,           2.6351,     12566.1517 },
			{ 425,            1.590,      3.523 },
			{ 119,            5.796,      26.298 },
			{ 109,            2.966,      1577.344 },
			{ 93,             2.59,       18849.23 },
			{ 72,             1.14,       529.69 },
			{ 68,             1.87,       398.15 },
			{ 67,             4.41,       5507.55 },
			{ 59,             2.89,       5223.69 },
			{ 56,             2.17,       155.42 },
			{ 45,             0.40,       796.30 },
			{ 36,             0.47,       775.52 },
			{ 29,             2.65,       7.11 },
			{ 21,             5.43,       0.98 },
			{ 19,             1.85,       5486.78 },
			{ 19,             4.97,       213.30 },
			{ 17,             2.99,       6275.96 },
			{ 16,             0.03,       2544.31 },
			{ 16,             1.43,       2146.17 },
			{ 15,             1.21,       10977.08 },
			{ 12,             2.83,       1748.02 },
			{ 12,             3.26,       5088.63 },
			{ 12,             5.27,       1194.45 },
			{ 12,             2.08,       4694.00 },
			{ 11,             0.77,       553.57 },
			{ 10,             1.30,       6286.60 },
			{ 10,             4.24,       1349.87 },
			{ 9,              2.70,       242.73 },
			{ 9,              5.64,       951.72 },
			{ 8,              5.30,       2352.87 },
			{ 6,              2.65,       9437.76 },
			{ 6,              4.67,       4690.48 }             
		},
		{ 
			{ 52919,  0,      0 },
			{ 8720,   1.0721, 6283.0758 },
			{ 309,    0.867,  12566.152 },
			{ 27,     0.05,   3.52 },
			{ 16,     5.19,   26.30 },
			{ 16,     3.68,   155.42 },
			{ 10,     0.76,   18849.23 },
			{ 9,      2.06,   77713.77 },
			{ 7,      0.83,   775.52 },
			{ 5,      4.66,   1577.34 },
			{ 4,      1.03,   7.11 },
			{ 4,      3.44,   5573.14 },
			{ 3,      5.14,   796.30 },
			{ 3,      6.05,   5507.55 },
			{ 3,      1.19,   242.73 },
			{ 3,      6.12,   529.69 },
			{ 3,      0.31,   398.15 },
			{ 3,      2.28,   553.57 },
			{ 2,      4.38,   5223.69 },
			{ 2,      3.75,   0.98 }     
		},
		{ 
			{ 289, 5.844, 6283.076 },
			{ 35,  0,     0 },
			{ 17,  5.49,  12566.15 },
			{ 3,   5.20,  155.42 },
			{ 1,   4.72,  3.52 },
			{ 1,   5.30,  18849.23 },
			{ 1,   5.97,  242.73 }
		},
		{ 
			{ 114, 3.142,  0 }, 
			{ 8,   4.13,   6283.08 },
			{ 1,   3.84,   12566.15 }
		},
		{ 
			{ 1, 3.14, 0 },
		}
	};


	// Heliocentric latitude.
	private static final double[][][] EARTH_B = {
		{ 
			{ 280, 3.199, 84334.662 },
			{ 102, 5.422, 5507.553 },
			{ 80,  3.88,  5223.69},
			{ 44,  3.70,  2352.87 },
			{ 32,  4.00,  1577.34 }
		},
		{ 
			{ 9, 3.90, 5507.55 },
			{ 6, 1.73, 5223.69}
		},
		{ 
			{ 22378, 3.38509, 10213.28555 },
			{ 282,   0,       0 },
			{ 173,   5.256,   20426.571 },
			{ 27,    3.87,    30639.86 }
		},
		{ 
			{ 647, 4.992, 10213.286 },
			{ 20,  3.14,  0 },
			{ 6,   0.77,  20426.57 },
			{ 3,   5.44,  30639.86 }
		},
		{ 
			{ 14, 0.32, 10213.29 }
		}
	};


	// Heliocentric radius vector.
	private static final double[][][] EARTH_R = {
		{ 
			{ 100013989,  0,          0 },
			{ 1670700,    3.0984635,  6283.0758500 },
			{ 13956,      3.05525,    12566.15170 },
			{ 3084,       5.1985,     77713.7715 },
			{ 1628,       1.1739,     5753.3849 },
			{ 1576,       2.8469,     7860.4194 },
			{ 925,        5.453,      11506.770 },
			{ 542,        4.564,      3930.210 },
			{ 472,        3.661,      5884.927 },
			{ 346,        0.964,      5507.553 },
			{ 329,        5.900,      5223.694 },
			{ 307,        0.299,      5573.143 },
			{ 243,        4.273,      11790.629 },
			{ 212,        5.847,      1577.344 },
			{ 186,        5.022,      10977.079 },
			{ 175,        3.012,      18849.228 },
			{ 110,        5.055,      5486.778 },
			{ 98,         0.89,       6069.78 },
			{ 86,         5.69,       15720.84 },
			{ 86,         1.27,       161000.69},
			{ 65,         0.27,       17260.15 },
			{ 63,         0.92,       529.69 },
			{ 57,         2.01,       83996.85 },
			{ 56,         5.24,       71430.70 },
			{ 49,         3.25,       2544.31 },
			{ 47,         2.58,       775.52 },
			{ 45,         5.54,       9437.76 },
			{ 43,         6.01,       6275.96 },
			{ 39,         5.36,       4694.00 },
			{ 38,         2.39,       8827.39 },
			{ 37,         0.83,       19651.05 },
			{ 37,         4.90,       12139.55 },
			{ 36,         1.67,       12036.46 },
			{ 35,         1.84,       2942.46 },
			{ 33,         0.24,       7084.90 },
			{ 32,         0.18,       5088.63 },
			{ 32,         1.78,       398.15 },
			{ 28,         1.21,       6286.60 },
			{ 28,         1.90,       6279.55 },
			{ 26,         4.59,       10447.39 }
		},
		{ 
			{ 103019, 1.107490, 6283.075850 },
			{ 1721,   1.0644,   12566.1517 },
			{ 702,    3.142,    0 },
			{ 32,     1.02,     18849.23 },
			{ 31,     2.84,     5507.55 },
			{ 25,     1.32,     5223.69 },
			{ 18,     1.42,     1577.34 },
			{ 10,     5.91,     10977.08 },
			{ 9,      1.42,     6275.96 },
			{ 9,      0.27,     5486.78 } 
		},
		{ 
			{ 4359, 5.7846, 6283.0758 },
			{ 124,  5.579,  12566.152 },
			{ 12,   3.14,   0 },
			{ 9,    3.63,   77713.77 },
			{ 6,    1.87,   5573.14 },
			{ 3,    5.47,   18849.23 } 
		},
		{ 
			{ 145,  4.273,  6283.076 },
			{ 7,    3.92,   12566.15 }
		},
		{ 
			{ 4, 2.56, 6283.08 }
		}
	};

	/**
	 * Tables of Vsop87 terms for the Earth.
	 */
	static Vsop87 EARTH = new Vsop87(EARTH_L, EARTH_B, EARTH_R);


	// ******************************************************************** //
	// Mars.
	// ******************************************************************** //

	// Heliocentric ecliptical longitude.
	private static final double[][][] MARS_L = {
		{ 
			{ 620347712,  0,          0 },
			{ 18656368,   5.05037100, 3340.61242670 },
			{ 1108217,    5.4009984,  6681.2248534 },
			{ 91798,      5.75479,    10021.83728 },
			{ 27745,      5.97050,    3.52312 },
			{ 12316,      0.84956,    2810.92146 },
			{ 10610,      2.93959,    2281.23050 },
			{ 8927,       4.1570,     0.0173 },
			{ 8716,       6.1101,     13362.4497 },
			{ 7775,       3.3397,     5621.8429 },
			{ 6798,       0.3646,     398.1490 },
			{ 4161,       0.2281,     2942.4634 },
			{ 3575,       1.6619,     2544.3144 },
			{ 3075,       0.8570,     191.4483 },
			{ 2938,       6.0789,     0.0673 },
			{ 2628,       0.6481,     3337.0893 },
			{ 2580,       0.0300,     3344.1355 },
			{ 2389,       5.0390,     796.2980 },
			{ 1799,       0.6563,     529.6910 },
			{ 1546,       2.9158,     1751.5395 },
			{ 1528,       1.1498,     6151.5339 },
			{ 1286,       3.0680,     2146.1654 },
			{ 1264,       3.6228,     5092.1520 },
			{ 1025,       3.6933,     8962.4553 },
			{ 892,        0.183,      16703.062 },
			{ 859,        2.401,      2914.014 },
			{ 833,        4.495,      3340.630 },
			{ 833,        2.464,      3340.595 },
			{ 749,        3.822,      155.420 },
			{ 724,        0.675,      3738.761 },
			{ 713,        3.663,      1059.382 },
			{ 655,        0.489,      3127.313 },
			{ 636,        2.922,      8432.764 },
			{ 553,        4.475,      1748.016 },
			{ 550,        3.810,      0.980 },
			{ 472,        3.625,      1194.447 },
			{ 426,        0.554,      6283.076 },
			{ 415,        0.497,      213.299 },
			{ 312,        0.999,      6677.702 },
			{ 307,        0.381,      6684.748 },
			{ 302,        4.486,      3532.061 },
			{ 299,        2.783,      6254.627 },
			{ 293,        4.221,      20.775 },
			{ 284,        5.769,      3149.164 },
			{ 281,        5.882,      1349.867 },
			{ 274,        0.542,      3340.545 },
			{ 274,        0.134,      3340.680 },
			{ 239,        5.372,      4136.910 },
			{ 236,        5.755,      3333.499 },
			{ 231,        1.282,      3870.303 },
			{ 221,        3.505,      382.897 },
			{ 204,        2.821,      1221.849 },
			{ 193,        3.357,      3.590 },
			{ 189,        1.491,      9492.146 },
			{ 179,        1.006,      951.718 },
			{ 174,        2.414,      553.569 },
			{ 172,        0.439,      5486.778 },
			{ 160,        3.949,      4562.461 },
			{ 144,        1.419,      135.065 },
			{ 140,        3.326,      2700.715 },
			{ 138,        4.301,      7.114 },
			{ 131,        4.045,      12303.068 },
			{ 128,        2.208,      1592.596 },
			{ 128,        1.807,      5088.629 },
			{ 117,        3.128,      7903.073 },
			{ 113,        3.701,      1589.073 },
			{ 110,        1.052,      242.729 },
			{ 105,        0.785,      8827.390 },
			{ 100,        3.243,      11773.377 }
		},
		{ 
			{ 334085627474.0, 0,          0 },
			{ 1458227,        3.6042605,  3340.6124267 },
			{ 164901,         3.926313,   6681.224853 },
			{ 19963,          4.26594,    10021.83728 },
			{ 3452,           4.7321,     3.5231 },
			{ 2485,           4.6128,     13362.4497 },
			{ 842,            4.459,      2281.230 },
			{ 538,            5.016,      398.149 },
			{ 521,            4.994,      3344.136 },
			{ 433,            2.561,      191.448 },
			{ 430,            5.316,      155.420 },
			{ 382,            3.539,      796.298 },
			{ 314,            4.963,      16703.062 },
			{ 283,            3.160,      2544.314 },
			{ 206,            4.569,      2146.165 },
			{ 169,            1.329,      3337.089 },
			{ 158,            4.185,      1751.540 },
			{ 134,            2.233,      0.980 },
			{ 134,            5.974,      1748.016 },
			{ 118,            6.024,      6151.534 },
			{ 117,            2.213,      1059.382 },
			{ 114,            2.129,      1194.447 },
			{ 114,            5.428,      3738.761 },
			{ 91,             1.10,       1349.87 },
			{ 85,             3.91,       553.57 },
			{ 83,             5.30,       6684.75 },
			{ 81,             4.43,       529.69 },
			{ 80,             2.25,       8962.46 },
			{ 73,             2.50,       951.72 },
			{ 73,             5.84,       242.73 },
			{ 71,             3.86,       2914.01 },
			{ 68,             5.02,       382.90 },
			{ 65,             1.02,       3340.60 },
			{ 65,             3.05,       3340.63 },
			{ 62,             4.15,       3149.16 },
			{ 57,             3.89,       4136.91 },
			{ 48,             4.87,       213.30 },
			{ 48,             1.18,       3333.50 },
			{ 47,             1.31,       3185.19 },
			{ 41,             0.71,       1592.60 },
			{ 40,             2.73,       7.11 },
			{ 40,             5.32,       20043.67 },
			{ 33,             5.41,       6283.08 },
			{ 28,             0.05,       9492.15 },
			{ 27,             3.89,       1221.85 },
			{ 27,             5.11,       2700.72 }
		},
		{ 
			{ 58016,  2.04979,  3340.61243 },
			{ 54188,  0,        0 },
			{ 13908,  2.45742,  6681.22485 },
			{ 2465,   2.8000,   10021.8373 },
			{ 398,    3.141,    13362.450 },
			{ 222,    3.194,    3.523 },
			{ 121,    0.543,    155.420 },
			{ 62,     3.49,     16703.06 },
			{ 54,     3.54,     3344.14 },
			{ 34,     6.00,     2281.23 },
			{ 32,     4.14,     191.45 },
			{ 30,     2.00,     796.30 },
			{ 23,     4.33,     242.73 },
			{ 22,     3.45,     398.15 },
			{ 20,     5.42,     553.57 },
			{ 16,     0.66,     0.98 },
			{ 16,     6.11,     2146.17 },
			{ 16,     1.22,     1748.02 },
			{ 15,     6.10,     3185.19 },
			{ 14,     4.02,     951.72 },
			{ 14,     2.62,     1349.87 },
			{ 13,     0.60,     1194.45 },
			{ 12,     3.86,     6684.75 },
			{ 11,     4.72,     2544.31 },
			{ 10,     0.25,     382.90 },
			{ 9,      0.68,     1059.38 },
			{ 9,      3.83,     20043.67 },
			{ 9,      3.88,     3738.76 },
			{ 8,      5.46,     1751.54 },
			{ 7,      2.58,     3149.16 },
			{ 7,      2.38,     4136.91 },
			{ 6,      5.48,     1592.60 },
			{ 6,      2.34,     3097.88 }

		},
		{ 
			{ 1482, 0.4443, 3340.6124 },
			{ 662,  0.885,  6681.225 },
			{ 188,  1.288,  10021.837 },
			{ 41,   1.65,   13362.45 },
			{ 26,   0,      0 },
			{ 23,   2.05,   155.42 },
			{ 10,   1.58,   3.52 },
			{ 8,    2.00,   16703.06 },
			{ 5,    2.82,   242.73 },
			{ 4,    2.02,   3344.14 },
			{ 3,    4.59,   3185.19 },
			{ 3,    0.65,   553.57 }
		},
		{ 
			{ 114,  3.1416, 0 },
			{ 29,   5.64,   6681.22 },
			{ 24,   5.14,   3340.61 },
			{ 11,   6.03,   10021.84 },
			{ 3,    0.13,   13362.45 },
			{ 3,    3.56,   155.42 },
			{ 1,    0.49,   16703.06 },
			{ 1,    1.32,   242.73 }
		},
		{ 
			{ 1,  3.14, 0 },
			{ 1,  4.04, 6681.22 }
		}
	};


	// Heliocentric latitude.
	private static final double[][][] MARS_B = {
		{ 
			{ 3197135,  3.7683204,  3340.6124267 },
			{ 298033,   4.106170,   6681.224853 },
			{ 289105,   0,          0 },
			{ 31366,    4.44651,    10021.83728 },
			{ 3484,     4.7881,     13362.4497 },
			{ 443,      5.026,      3344.136 },
			{ 443,      5.652,      3337.089 },
			{ 399,      5.131,      16703.062 },
			{ 293,      3.793,      2281.230 },
			{ 182,      6.136,      6151.534 },
			{ 163,      4.264,      529.691 },
			{ 160,      2.232,      1059.382 },
			{ 149,      2.165,      5621.843 },
			{ 143,      1.182,      3340.595},
			{ 143,      3.213,      3340.630 },
			{ 139,      2.418,      8962.455 }
		},
		{ 
			{ 350069, 5.368478, 3340.612427 },
			{ 14116,  3.14159,  0 },
			{ 9671,   5.4788,   6681.2249 },
			{ 1472,   3.2021,   10021.8373 },
			{ 426,    3.408,    13362.450 },
			{ 102,    0.776,    3337.089 },
			{ 79,     3.72,     16703.06 },
			{ 33,     3.46,     5621.84 },
			{ 26,     2.48,     2281.23 }
		},
		{ 
			{ 16727,  0.60221,  3340.61243 },
			{ 4987,   4.1416,   0 },
			{ 302,    3.559,    6681.225 },
			{ 26,     1.90,     13362.45 },
			{ 21,     0.92,     10021.84 },
			{ 12,     2.24,     3337.09 },
			{ 8,      2.25,     16703.06 }
		},
		{ 
			{ 607,  1.981,  3340.612 },
			{ 43,   0,      0 },
			{ 14,   1.80,   6681.22 },
			{ 3,    3.45,   10021.84 }
		},
		{ 
			{ 13, 0,    0 },
			{ 11, 3.46, 3340.61 },
			{ 1,  0.50, 6681.22 }
		}
	};


	// Heliocentric radius vector.
	private static final double[][][] MARS_R = {
		{ 
			{ 153033488,  0,          0 },
			{ 14184953,   3.47971284, 3340.61242670 },
			{ 660776,     3.817834,   6681.224853 },
			{ 46179,      4.15595,    10021.83728 },
			{ 8110,       5.5596,     2810.9215 },
			{ 7485,       1.7724,     5621.8429 },
			{ 5523,       1.3644,     2281.2305 },
			{ 3825,       4.4941,     13362.4497 },
			{ 2484,       4.9255,     2942.4634 },
			{ 2307,       0.0908,     2544.3144 },
			{ 1999,       5.3606,     3337.0893 },
			{ 1960,       4.7425,     3344.1355 },
			{ 1167,       2.1126,     5092.1520 },
			{ 1103,       5.0091,     398.1490 },
			{ 992,        5.839,      6151.534 },
			{ 899,        4.408,      529.691 },
			{ 807,        2.102,      1059.382 },
			{ 798,        3.448,      796.298 },
			{ 741,        1.499,      2146.165 },
			{ 726,        1.245,      8432.764 },
			{ 692,        2.134,      8962.455 },
			{ 633,        0.894,      3340.595 },
			{ 633,        2.924,      3340.630 },
			{ 630,        1.287,      1751.540 },
			{ 574,        0.829,      2914.014 },
			{ 526,        5.383,      3738.761 },
			{ 473,        5.199,      3127.313 },
			{ 348,        4.832,      16703.062 },
			{ 284,        2.907,      3532.061 },
			{ 280,        5.257,      6283.076 },
			{ 276,        1.218,      6254.627 },
			{ 275,        2.908,      1748.016 },
			{ 270,        3.764,      5884.927 },
			{ 239,        2.037,      1194.447 },
			{ 234,        5.105,      5486.778 },
			{ 228,        3.255,      6872.673 },
			{ 223,        4.199,      3149.164 },
			{ 219,        5.583,      191.448 },
			{ 208,        5.255,      3340.545 },
			{ 208,        4.846,      3340.680 },
			{ 186,        5.699,      6677.702 },
			{ 183,        5.081,      6684.748 },
			{ 179,        4.184,      3333.499 },
			{ 176,        5.953,      3870.303 },
			{ 164,        3.799,      4136.910 }
		},
		{ 
			{ 1107433,  2.0325052,  3340.6124267 },
			{ 103176,   2.370718,   6681.224853 },
			{ 12877,    0,          0 },
			{ 10816,    2.70888,    10021.83728 },
			{ 1195,     3.0470,     13362.4497 },
			{ 439,      2.888,      2281.230 },
			{ 396,      3.423,      3344.136 },
			{ 183,      1.584,      2544.314 },
			{ 136,      3.385,      16703.062 },
			{ 128,      6.043,      3337.089 },
			{ 128,      0.630,      1059.382 },
			{ 127,      1.954,      796.298 },
			{ 118,      2.998,      2146.165 },
			{ 88,       3.42,       398.15 },
			{ 83,       3.86,       3738.76 },
			{ 76,       4.45,       6151.53 },
			{ 72,       2.76,       529.69 },
			{ 67,       2.55,       1751.54 },
			{ 66,       4.41,       1748.02 },
			{ 58,       0.54,       1194.45 },
			{ 54,       0.68,       8962.46 },
			{ 51,       3.73,       6684.75 },
			{ 49,       5.73,       3340.60 },
			{ 49,       1.48,       3340.63 },
			{ 48,       2.58,       3149.16 },
			{ 48,       2.29,       2914.01 },
			{ 39,       2.32,       4136.91 }
		},
		{ 
			{ 44242,  0.47931,  3340.61243 },
			{ 8138,   0.8700,   6681.2249 },
			{ 1275,   1.2259,   10021.8373 },
			{ 187,    1.573,    13362.450 },
			{ 52,     3.14,     0 },
			{ 41,     1.97,     3344.14 },
			{ 27,     1.92,     16703.06 },
			{ 18,     4.43,     2281.23 },
			{ 12,     4.53,     3185.19 },
			{ 10,     5.39,     1059.38 },
			{ 10,     0.42,     796.30 }
		},
		{ 
			{ 1113, 5.1499, 3340.6124 },
			{ 424,  5.613,  6681.225 },
			{ 100,  5.997,  10021.837 },
			{ 20,   0.08,   13362.45 },
			{ 5,    3.14,   0 },
			{ 3,    0.43,   16703.06 }  
		},
		{ 
			{ 20, 3.58, 3340.61 },
			{ 16, 4.05, 6681.22 },
			{ 6,  4.46, 10021.84 },
			{ 2,  4.84, 13362.45 }
		}
	};

	/**
	 * Tables of Vsop87 terms for Mars.
	 */
	static Vsop87 MARS = new Vsop87(MARS_L, MARS_B, MARS_R);


	// ******************************************************************** //
	// Jupiter.
	// ******************************************************************** //

	// Heliocentric ecliptical longitude.
	private static final double[][][] JUPITER_L = {
		{ 
			{ 59954691, 0,          0 },
			{ 9695899,  5.0619179,  529.6909651 },
			{ 573610,   1.444062,   7.113547 },
			{ 306389,   5.417347,   1059.381930 },
			{ 97178,    4.14265,    632.78374 },
			{ 72903,    3.64043,    522.57742 },
			{ 64264,    3.41145,    103.09277 },
			{ 39806,    2.29377,    419.48464 },
			{ 38858,    1.27232,    316.39187 },
			{ 27965,    1.78455,    536.80451 },
			{ 13590,    5.77481,    1589.07290 },
			{ 8769,     3.6300,     949.1756 },
			{ 8246,     3.5823,     206.1855 },
			{ 7368,     5.0810,     735.8765 },
			{ 6263,     0.0250,     213.2991 },
			{ 6114,     4.5132,     1162.4747 },
			{ 5305,     4.1863,     1052.2684 },
			{ 5305,     1.3067,     14.2271 },
			{ 4905,     1.3208,     110.2063 },
			{ 4647,     4.6996,     3.9322 },
			{ 3045,     4.3168,     426.5982 },
			{ 2610,     1.5667,     846.0828 },
			{ 2028,     1.0638,     3.1814 },
			{ 1921,     0.9717,     639.8973 },
			{ 1765,     2.1415,     1066.4955 },
			{ 1723,     3.8804,     1265.5675 },
			{ 1633,     3.5820,     515.4639 },
			{ 1432,     4.2968,     625.6702 },
			{ 973,      4.098,      95.979 },
			{ 884,      2.437,      412.371 },
			{ 733,      6.085,      838.969 },
			{ 731,      3.806,      1581.959 },
			{ 709,      1.293,      742.990 },
			{ 692,      6.134,      2118.764 },
			{ 614,      4.109,      1478.867 },
			{ 582,      4.540,      309.278 },
			{ 495,      3.756,      323.505 },
			{ 441,      2.958,      454.909 },
			{ 417,      1.036,      2.488 },
			{ 390,      4.897,      1692.166 },
			{ 376,      4.703,      1368.660 },
			{ 341,      5.715,      533.623 },
			{ 330,      4.740,      0.048 },
			{ 262,      1.877,      0.963 },
			{ 261,      0.820,      380.128 },
			{ 257,      3.724,      199.072 },
			{ 244,      5.220,      728.763 },
			{ 235,      1.227,      909.819 },
			{ 220,      1.651,      543.918 },
			{ 207,      1.855,      525.759 },
			{ 202,      1.807,      1375.774 },
			{ 197,      5.293,      1155.361 },
			{ 175,      3.730,      942.062 },
			{ 175,      3.226,      1898.351 },
			{ 175,      5.910,      956.289 },
			{ 158,      4.365,      1795.258 },
			{ 151,      3.906,      74.782 },
			{ 149,      4.377,      1685.052 },
			{ 141,      3.136,      491.558 },
			{ 138,      1.318,      1169.588 },
			{ 131,      4.169,      1045.155 },
			{ 117,      2.500,      1596.186 },
			{ 117,      3.389,      0.521 },
			{ 106,      4.554,      526.510 }
		},
		{ 
			{ 52993480757.0, 0,          0 },
			{ 489741,        4.220667,   529.690965 },
			{ 228919,        6.026475,   7.113547 },
			{ 27655,         4.57266,    1059.38193 },
			{ 20721,         5.45939,    522.57742 },
			{ 12106,         0.16986,    536.80451 },
			{ 6068,          4.4242,     103.0928 },
			{ 5434,          3.9848,     419.4846 },
			{ 4238,          5.8901,     14.2271 },
			{ 2212,          5.2677,     206.1855 },
			{ 1746,          4.9267,     1589.0729 },
			{ 1296,          5.5513,     3.1814 },
			{ 1173,          5.8565,     1052.2684 },
			{ 1163,          0.5145,     3.9322 },
			{ 1099,          5.3070,     515.4639 },
			{ 1007,          0.4648,     735.8765 },
			{ 1004,          3.1504,     426.5982 },
			{ 848,           5.758,      110.206 },
			{ 827,           4.803,      213.299 },
			{ 816,           0.586,      1066.495 },
			{ 725,           5.518,      639.897 },
			{ 568,           5.989,      625.670 },
			{ 474,           4.132,      412.371 },
			{ 413,           5.737,      95.979 },
			{ 345,           4.242,      632.784 },
			{ 336,           3.732,      1162.475 },
			{ 234,           4.035,      949.176 },
			{ 234,           6.243,      309.278 },
			{ 199,           1.505,      838.969 },
			{ 195,           2.219,      323.505 },
			{ 187,           6.086,      742.990 },
			{ 184,           6.280,      543.918 },
			{ 171,           5.417,      199.072 },
			{ 131,           0.626,      728.763 },
			{ 115,           0.680,      846.083 },
			{ 115,           5.286,      2118.764 },
			{ 108,           4.493,      956.289 },
			{ 80,            5.82,       1045.15 },
			{ 72,            5.34,       942.06 },
			{ 70,            5.97,       532.87 },
			{ 67,            5.73,       21.34 },
			{ 66,            0.13,       526.51 },
			{ 65,            6.09,       1581.96 },
			{ 59,            0.59,       1155.36 },
			{ 58,            0.99,       1596.19 },
			{ 57,            5.97,       1169.59 },
			{ 57,            1.41,       533.62 },
			{ 55,            5.43,       10.29 },
			{ 52,            5.73,       117.32 },
			{ 52,            0.23,       1368.66 },
			{ 50,            6.08,       525.76 },
			{ 47,            3.63,       1478.87 },
			{ 47,            0.51,       1265.57 },
			{ 40,            4.16,       1692.17 },
			{ 34,            0.10,       302.16 },
			{ 33,            5.04,       220.41 },
			{ 32,            5.37,       508.35 },
			{ 29,            5.42,       1272.68 },
			{ 29,            3.36,       4.67 },
			{ 29,            0.76,       88.87 },
			{ 25,            1.61,       831.86 }
		},
		{ 
			{ 47234,  4.32148,  7.11355 },
			{ 38966,  0,        0 },
			{ 30629,  2.93021,  529.69097 },
			{ 3189,   1.0550,   522.5774 },
			{ 2729,   4.8455,   536.8045 },
			{ 2723,   3.4141,   1059.3819 },
			{ 1721,   4.1873,   14.2271 },
			{ 383,    5.768,    419.485 },
			{ 378,    0.760,    515.464 },
			{ 367,    6.055,    103.093 },
			{ 337,    3.786,    3.181 },
			{ 308,    0.694,    206.186 },
			{ 218,    3.814,    1589.073 },
			{ 199,    5.340,    1066.495 },
			{ 197,    2.484,    3.932 },
			{ 156,    1.406,    1052.268 },
			{ 146,    3.814,    639.897 },
			{ 142,    1.634,    426.598 },
			{ 130,    5.837,    412.371 },
			{ 117,    1.414,    625.670 },
			{ 97,     4.03,     110.21 },
			{ 91,     1.11,     95.98 },
			{ 87,     2.52,     632.78 },
			{ 79,     4.64,     543.92 },
			{ 72,     2.22,     735.88 },
			{ 58,     0.83,     199.07 },
			{ 57,     3.12,     213.30 },
			{ 49,     1.67,     309.28 },
			{ 40,     4.02,     21.34 },
			{ 40,     0.62,     323.51 },
			{ 36,     2.33,     728.76 },
			{ 29,     3.61,     10.29 },
			{ 28,     3.24,     838.97 },
			{ 26,     4.50,     742.99 },
			{ 26,     2.51,     1162.47 },
			{ 25,     1.22,     1045.15 },
			{ 24,     3.01,     956.29 },
			{ 19,     4.29,     532.87 },
			{ 18,     0.81,     508.35 },
			{ 17,     4.20,     2118.76 },
			{ 17,     1.83,     526.51 },
			{ 15,     5.81,     1596.19 },
			{ 15,     0.68,     942.06 },
			{ 15,     4.00,     117.32 },
			{ 14,     5.95,     316.39 },
			{ 14,     1.80,     302.16 },
			{ 13,     2.52,     88.87 },
			{ 13,     4.37,     1169.59 },
			{ 11,     4.44,     525.76 },
			{ 10,     1.72,     1581.96 },
			{ 9,      2.18,     1155.36 },
			{ 9,      3.29,     220.41 },
			{ 9,      3.32,     831.86 },
			{ 8,      5.76,     846.08 },
			{ 8,      2.71,     533.62 },
			{ 7,      2.18,     1265.57 },
			{ 6,      0.50,     949.18 }     
		},
		{ 
			{ 6502, 2.5986, 7.1135 },
			{ 1357, 1.3464, 529.6910 },
			{ 471,  2.475,  14.227 },
			{ 417,  3.245,  536.805 },
			{ 353,  2.974,  522.577 },
			{ 155,  2.076,  1059.382 },
			{ 87,   2.51,   515.46 },
			{ 44,   0,      0 },
			{ 34,   3.83,   1066.50 },
			{ 28,   2.45,   206.19 },
			{ 24,   1.28,   412.37 },
			{ 23,   2.98,   543.92 },
			{ 20,   2.10,   639.90 },
			{ 20,   1.40,   419.48 },
			{ 19,   1.59,   103.09 },
			{ 17,   2.30,   21.34 },
			{ 17,   2.60,   1589.07 },
			{ 16,   3.15,   625.67 },
			{ 16,   3.36,   1052.27 },
			{ 13,   2.76,   95.98 },
			{ 13,   2.54,   199.07 },
			{ 13,   6.27,   426.60 },
			{ 9,    1.76,   10.29 },
			{ 9,    2.27,   110.21 },
			{ 7,    3.43,   309.28 },
			{ 7,    4.04,   728.76 },
			{ 6,    2.52,   508.35 },
			{ 5,    2.91,   1045.15 },
			{ 5,    5.25,   323.51 },
			{ 4,    4.30,   88.87 },
			{ 4,    3.52,   302.16 },
			{ 4,    4.09,   735.88 },
			{ 3,    1.43,   956.29 },
			{ 3,    4.36,   1596.19 },
			{ 3,    1.25,   213.30 },
			{ 3,    5.02,   838.97 },
			{ 3,    2.24,   117.32 },
			{ 2,    2.90,   742.99 },
			{ 2,    2.36,   942.06 }
		},
		{ 
			{ 669,  0.853,  7.114 },
			{ 114,  3.142,  0 },
			{ 100,  0.743,  14.227 },
			{ 50,   1.65,   536.80 },
			{ 44,   5.82,   529.69 },
			{ 32,   4.86,   522.58 },
			{ 15,   4.29,   515.46 },
			{ 9,    0.71,   1059.38 },
			{ 5,    1.30,   543.92 },
			{ 4,    2.32,   1066.50 },
			{ 4,    0.48,   21.34 },
			{ 3,    3.00,   412.37 },
			{ 2,    0.40,   639.90 },
			{ 2,    4.26,   199.07 },
			{ 2,    4.91,   625.67 },
			{ 2,    4.26,   206.19 },
			{ 1,    5.26,   1052.27 },
			{ 1,    4.72,   95.98 },
			{ 1,    1.29,   1589.07 }
		},
		{ 
			{ 50, 5.26, 7.11 },
			{ 16, 5.25, 14.23 },
			{ 4,  0.01, 536.80 },
			{ 2,  1.10, 522.58 },
			{ 1,  3.14, 0 }
		}
	};


	// Heliocentric latitude.
	private static final double[][][] JUPITER_B = {
		{ 
			{ 2268616,  3.5585261,  529.6909651 },
			{ 110090,   0,          0 },
			{ 109972,   3.908093,   1059.381930 },
			{ 8101,     3.6051,     522.5774 },
			{ 6438,     0.3063,     536.8045 },
			{ 6044,     4.2588,     1589.0729 },
			{ 1107,     2.9853,     1162.4747 },
			{ 944,      1.675,      426.598 },
			{ 942,      2.936,      1052.268 },
			{ 894,      1.754,      7.114 },
			{ 836,      5.179,      103.093 },
			{ 767,      2.155,      632.784 },
			{ 684,      3.678,      213.299 },
			{ 629,      0.643,      1066.495 },
			{ 559,      0.014,      846.083 },
			{ 532,      2.703,      110.206 },
			{ 464,      1.173,      949.176 },
			{ 431,      2.608,      419.485 },
			{ 351,      4.611,      2118.764 },
			{ 132,      4.778,      742.990 },
			{ 123,      3.350,      1692.166 },
			{ 116,      1.387,      323.505 },
			{ 115,      5.049,      316.392 },
			{ 104,      3.701,      515.464 },
			{ 103,      2.319,      1478.867 },
			{ 102,      3.153,      1581.959 }
		},
		{ 
			{ 177352, 5.701665, 529.690965 },
			{ 3230,   5.7794,   1059.3819 },
			{ 3081,   5.4746,   522.5774 },
			{ 2212,   4.7348,   536.8045 },
			{ 1694,   3.1416,   0 },
			{ 346,    4.746,    1052.268 },
			{ 234,    5.189,    1066.495 },
			{ 196,    6.186,    7.114 },
			{ 150,    3.927,    1589.073 },
			{ 114,    3.439,    632.784 },
			{ 97,     2.91,     949.18 },
			{ 82,     5.08,     1162.47 },
			{ 77,     2.51,     103.09 },
			{ 77,     0.61,     419.48 },
			{ 74,     5.50,     515.46 },
			{ 61,     5.45,     213.30 },
			{ 50,     3.95,     735.88 },
			{ 46,     0.54,     110.21 },
			{ 45,     1.90,     846.08 },
			{ 37,     4.70,     543.92 },
			{ 36,     6.11,     316.39 },
			{ 32,     4.92,     1581.96 }
		},
		{ 
			{ 8094, 1.4632, 529.6910 },
			{ 813,  3.1416, 0 },
			{ 742,  0.957,  522.577 },
			{ 399,  2.899,  536.805 },
			{ 342,  1.447,  1059.382 },
			{ 74,   0.41,   1052.27 },
			{ 46,   3.48,   1066.50 },
			{ 30,   1.93,   1589.07 },
			{ 29,   0.99,   515.46 },
			{ 23,   4.27,   7.11 },
			{ 14,   2.92,   543.92 },
			{ 12,   5.22,   632.78 },
			{ 11,   4.88,   949.18 },
			{ 6,    6.21,   1045.15 }
		},
		{ 
			{ 252,  3.381,  529.691 },
			{ 122,  2.733,  522.577 },
			{ 49,   1.04,   536.80 },
			{ 11,   2.31,   1052.27 },
			{ 8,    2.77,   515.46 },
			{ 7,    4.25,   1059.38 },
			{ 6,    1.78,   1066.50 },
			{ 4,    1.13,   543.92 },
			{ 3,    3.14,   0 }
		},
		{ 
			{ 15, 4.53, 522.58 },
			{ 5,  4.47, 529.69 },
			{ 4,  5.44, 536.80 },
			{ 3,  0,    0 },
			{ 2,  4.52, 515.46 },
			{ 1,  4.20, 1052.27 }
		},
		{ 
			{ 1,  0.09, 522.58 }
		}
	};


	// Heliocentric radius vector.
	private static final double[][][] JUPITER_R = {
		{ 
			{ 520887429,  0,          0 },
			{ 25209327,   3.49108640, 529.69096509 },
			{ 610600,     3.841154,   1059.381930 },
			{ 282029,     2.574199,   632.783739 },
			{ 187647,     2.075904,   522.577418 },
			{ 86793,      0.71001,    419.48464 },
			{ 72063,      0.21466,    536.80451 },
			{ 65517,      5.97996,    316.39187 },
			{ 30135,      2.16132,    949.17561 },
			{ 29135,      1.67759,    103.09277 },
			{ 23947,      0.27458,    7.11355 },
			{ 23453,      3.54023,    735.87651 },
			{ 22284,      4.19363,    1589.07290 },
			{ 13033,      2.96043,    1162.47470 },
			{ 12749,      2.71550,    1052.26838 },
			{ 9703,       1.9067,     206.1855 },
			{ 9161,       4.4135,     213.2991 },
			{ 7895,       2.4791,     426.5982 },
			{ 7058,       2.1818,     1265.5675 },
			{ 6138,       6.2642,     846.0828 },
			{ 5477,       5.6573,     639.8973 },
			{ 4170,       2.0161,     515.4639 },
			{ 4137,       2.7222,     625.6702 },
			{ 3503,       0.5653,     1066.4955 },
			{ 2617,       2.0099,     1581.9593 },
			{ 2500,       4.5518,     838.9693 },
			{ 2128,       6.1275,     742.9901 },
			{ 1912,       0.8562,     412.3711 },
			{ 1611,       3.0887,     1368.6603 },
			{ 1479,       2.6803,     1478.8666 },
			{ 1231,       1.8904,     323.5054 },
			{ 1217,       1.8017,     110.2063 },
			{ 1015,       1.3867,     454.9094 },
			{ 999,        2.872,      309.278 },
			{ 961,        4.549,      2118.764 },
			{ 886,        4.148,      533.623 },
			{ 821,        1.593,      1898.351 },
			{ 812,        5.941,      909.819 },
			{ 777,        3.677,      728.763 },
			{ 727,        3.988,      1155.361 },
			{ 655,        2.791,      1685.052 },
			{ 654,        3.382,      1692.166 },
			{ 621,        4.823,      956.289 },
			{ 615,        2.276,      942.062 },
			{ 562,        0.081,      543.918 },
			{ 542,        0.284,      525.759 }
		},
		{ 
			{ 1271802,2.6493751,  529.6909651 },
			{ 61662,  3.00076,    1059.38193 },
			{ 53444,  3.89718,    522.57742 },
			{ 41390,  0,          0 },
			{ 31185,  4.88277,    536.80451 },
			{ 11847,  2.41330,    419.48464 },
			{ 9166,   4.7598,     7.1135 },
			{ 3404,   3.3469,     1589.0729 },
			{ 3203,   5.2108,     735.8765 },
			{ 3176,   2.7930,     103.0928 },
			{ 2806,   3.7422,     515.4639 },
			{ 2677,   4.3305,     1052.2684 },
			{ 2600,   3.6344,     206.1855 },
			{ 2412,   1.4695,     426.5982 },
			{ 2101,   3.9276,     639.8973 },
			{ 1646,   4.4163,     1066.4955 },
			{ 1641,   4.4163,     625.6702 },
			{ 1050,   3.1611,     213.2991 },
			{ 1025,   2.5543,     412.3711 },
			{ 806,    2.678,      632.784 },
			{ 741,    2.171,      1162.475 },
			{ 677,    6.250,      838.969 },
			{ 567,    4.577,      742.990 },
			{ 485,    2.469,      949.176 },
			{ 469,    4.710,      543.918 },
			{ 445,    0.403,      323.505 },
			{ 416,    5.368,      728.763 },
			{ 402,    4.605,      309.278 },
			{ 347,    4.681,      14.227 },
			{ 338,    3.168,      956.289 },
			{ 261,    5.343,      846.083 },
			{ 247,    3.923,      942.062 },
			{ 220,    4.842,      1368.660 },
			{ 203,    5.600,      1155.361 },
			{ 200,    4.439,      1045.155 },
			{ 197,    3.706,      2118.764 },
			{ 196,    3.759,      199.072 },
			{ 184,    4.265,      95.979 },
			{ 180,    4.402,      532.872 },
			{ 170,    4.846,      526.510 },
			{ 146,    6.130,      533.623 },
			{ 133,    1.322,      110.206 },
			{ 132,    4.512,      525.759 }
		},
		{ 
			{ 79645,  1.35866,  529.69097 },
			{ 8252,   5.7777,   522.5774 },
			{ 7030,   3.2748,   536.8045 },
			{ 5314,   1.8384,   1059.3819 },
			{ 1861,   2.9768,   7.1135 },
			{ 964,    5.480,    515.464 },
			{ 836,    4.199,    419.485 },
			{ 498,    3.142,    0 },
			{ 427,    2.228,    639.897 },
			{ 406,    3.783,    1066.495 },
			{ 377,    2.242,    1589.073 },
			{ 363,    5.368,    206.186 },
			{ 342,    6.099,    1052.268 },
			{ 339,    6.127,    625.670 },
			{ 333,    0.003,    426.598 },
			{ 280,    4.262,    412.371 },
			{ 257,    0.963,    632.784 },
			{ 230,    0.705,    735.877 },
			{ 201,    3.069,    543.918 },
			{ 200,    4.429,    103.093 },
			{ 139,    2.932,    14.227 },
			{ 114,    0.787,    728.763 },
			{ 95,     1.70,     838.97 },
			{ 86,     5.14,     323.51 },
			{ 83,     0.06,     309.28 },
			{ 80,     2.98,     742.99 },
			{ 75,     1.60,     956.29 },
			{ 70,     1.51,     213.30 },
			{ 67,     5.47,     199.07 },
			{ 62,     6.10,     1045.15 },
			{ 56,     0.96,     1162.47 },
			{ 52,     5.58,     942.06 },
			{ 50,     2.72,     532.87 },
			{ 45,     5.52,     508.35 },
			{ 44,     0.27,     526.51 },
			{ 40,     5.95,     95.98 }   
		},
		{ 
			{ 3519, 6.0580, 529.6910 },
			{ 1073, 1.6732, 536.8045 },
			{ 916,  1.413,  522.577 },
			{ 342,  0.523,  1059.382 },
			{ 255,  1.196,  7.114 },
			{ 222,  0.952,  515.464 },
			{ 90,   3.14,   0 },
			{ 69,   2.27,   1066.50 },
			{ 58,   1.41,   543.92 },
			{ 58,   0.53,   639.90 },
			{ 51,   5.98,   412.37 },
			{ 47,   1.58,   625.67 },
			{ 43,   6.12,   419.48 },
			{ 37,   1.18,   14.23 },
			{ 34,   1.67,   1052.27 },
			{ 34,   0.85,   206.19 },
			{ 31,   1.04,   1589.07 },
			{ 30,   4.63,   426.60 },
			{ 21,   2.50,   728.76 },
			{ 15,   0.89,   199.07 },
			{ 14,   0.96,   508.35 },
			{ 13,   1.50,   1045.15 },
			{ 12,   2.61,   735.88 },
			{ 12,   3.56,   323.51 },
			{ 11,   1.79,   309.28 },
			{ 11,   6.28,   956.29 },
			{ 10,   6.26,   103.09 },
			{ 9,    3.45,   838.97 }
		},
		{ 
			{ 129,  0.084,  536.805 },
			{ 113,  4.249,  529.691 },
			{ 83,   3.30,   522.58 },
			{ 38,   2.73,   515.46 }, 
			{ 27,   5.69,   7.11 },
			{ 18,   5.40,   1059.38 },
			{ 13,   6.02,   543.92 },
			{ 9,    0.77,   1066.50 },
			{ 8,    5.68,   14.23 },
			{ 7,    1.43,   412.37 },
			{ 6,    5.12,   639.90 },
			{ 5,    3.34,   625.67 },
			{ 3,    3.40,   1052.27 },
			{ 3,    4.16,   728.76 },
			{ 3,    2.90,   426.60 }
		},
		{ 
			{ 11, 4.75, 536.80 },
			{ 4,  5.92, 522.58 },
			{ 2,  5.57, 515.46 },
			{ 2,  4.30, 543.92 },
			{ 2,  3.69, 7.11 },
			{ 2,  4.13, 1059.38 },
			{ 2,  5.49, 1066.50 }
		}
	};

	/**
	 * Tables of Vsop87 terms for Jupiter.
	 */
	static Vsop87 JUPITER = new Vsop87(JUPITER_L, JUPITER_B, JUPITER_R);


	// ******************************************************************** //
	// Saturn.
	// ******************************************************************** //

	// Heliocentric ecliptical longitude.
	private static final double[][][] SATURN_L = {
		{ 
			{ 87401354,	  0,	        0 },
			{ 11107660,	  3.96205090,	213.29909544 },
			{ 1414151,	  4.5858152,	7.1135470 },
			{ 398379,	    0.521120,	  206.185548 },
			{ 350769,	    3.303299,	  426.598191 },
			{ 206816,	    0.246584,	  103.092774 },
			{ 79271,	    3.84007,	  220.41264 },
			{ 23990,	    4.66977,	  110.20632 },
			{ 16574,	    0.43719,	  419.48464 },
			{ 15820,	    0.93809,	  632.78374 },
			{ 15054,	    2.71670,	  639.89729 },
			{ 14907,	    5.76903,	  316.39187 },
			{ 14610,	    1.56519,	  3.93215 },
			{ 13160,	    4.44891,	  14.22709 },
			{ 13005,	    5.98119,	  11.04570 },
			{ 10725,	    3.12940,	  202.25340 },
			{ 6126,	      1.7633,	    277.0350 },
			{ 5863,	      0.2366,	    529.6910 },
			{ 5228,	      4.2078,	    3.1814 },
			{ 5020,	      3.1779,	    433.7117 },
			{ 4593,	      0.6198,	    199.0720 },
			{ 4006,	      2.2448,	    63.7359 },
			{ 3874,	      3.2228,	    138.5175 },
			{ 3269,	      0.7749,	    949.1756 },
			{ 2954,	      0.9828,	    95.9792 },
			{ 2461,	      2.0316,	    735.8765 },
			{ 1758,	      3.2658,	    522.5774 },
			{ 1640,	      5.5050,	    846.0828 },
			{ 1581,	      4.3727,	    309.2783 },
			{ 1391,	      4.0233,	    323.5054 },
			{ 1124,	      2.8373,	    415.5525 },
			{ 1087,	      4.1834,	    2.4477 },
			{ 1017,	      3.7170,	    227.5262 },
			{ 957,	      0.507,	    1265.567 },
			{ 853,	      3.421,	    175.166 },
			{ 849,	      3.191,	    209.367 },
			{ 789,	      5.007,	    0.963 },
			{ 749,	      2.144,	    853.196 },
			{ 744,	      5.253,	    224.345 },
			{ 687,	      1.747,	    1052.268 },
			{ 654,	      1.599,	    0.048 },
			{ 634,	      2.299,	    412.371 },
			{ 625,	      0.970,	    210.118 },
			{ 580,	      3.093,	    74.782 },
			{ 546,	      2.127,	    350.332 },
			{ 543,	      1.518,	    9.561 },
			{ 530,	      4.449,	    117.320 },
			{ 478,	      2.965,	    137.033 },
			{ 474,	      5.475,	    742.990 },
			{ 452,	      1.044,	    490.334 },
			{ 449,	      1.290,	    127.472 },
			{ 372,	      2.278,	    217.231 },
			{ 355,	      3.013,	    838.969 },
			{ 347,	      1.539,	    340.771 },
			{ 343,	      0.246,	    0.521 },
			{ 330,	      0.247,	    1581.959 },
			{ 322,	      0.961,	    203.738 },
			{ 322,	      2.572,	    647.011 },
			{ 309,	      3.495,	    216.480 },
			{ 287,	      2.370,	    351.817 },
			{ 278,	      0.400,	    211.815 },
			{ 249,	      1.470,	    1368.660 },
			{ 227,	      4.910,	    12.530 },
			{ 220,	      4.204,	    200.769 },
			{ 209,	      1.345,	    625.670 },
			{ 208,	      0.483,	    1162.475 },
			{ 208,	      1.283,	    39.357 },
			{ 204,	      6.011,	    265.989 },
			{ 185,	      3.503,	    149.563 },
			{ 184,	      0.973,	    4.193 },
			{ 182,	      5.491,	    2.921 },
			{ 174,	      1.863,	    0.751 },
			{ 165,	      0.440,	    5.417 },
			{ 149,	      5.736,	    52.690 },
			{ 148,	      1.535,	    5.629 },
			{ 146,	      6.231,	    195.140 },
			{ 140,	      4.295,	    21.341 },
			{ 131,	      4.068,	    10.295 },
			{ 125,	      6.277,	    1898.351 },
			{ 122,	      1.976,	    4.666 },
			{ 118,	      5.341,	    554.070 },
			{ 117,	      2.679,	    1155.361 },
			{ 114,	      5.594,	    1059.382 },
			{ 112,	      1.105,	    191.208 },
			{ 110,	      0.166,	    1.484 },
			{ 109,	      3.438,	    536.805 },
			{ 107,	      4.012,	    956.289 },
			{ 104,	      2.192,	    88.866 },
			{ 103,	      1.197,	    1685.052 },
			{ 101,	      4.965,	    269.921 }
		},
		{ 
			{ 21354295596.0, 0,        	0 },
			{ 1296855,    	 1.8282054,	213.2990954 },
			{ 564348,	       2.885001,	7.113547 },
			{ 107679,	       2.277699,	206.185548 },
			{ 98323,	       1.08070,	  426.59819 },
			{ 40255,	       2.04128,	  220.41264 },
			{ 19942,	       1.27955,	  103.09277 },
			{ 10512,	       2.74880,	  14.22709 },
			{ 6939,	         0.4049,	  639.8973 },
			{ 4803,	         2.4419,	  419.4846 },
			{ 4056,	         2.9217,	  110.2063 },
			{ 3769,	         3.6497,	  3.9322 },
			{ 3385,	         2.4169,	  3.1814 },
			{ 3302,	         1.2626,	  433.7117 },
			{ 3071,	         2.3274,	  199.0720 },
			{ 1953,	         3.5639,	  11.0457 },
			{ 1249,	         2.6280,	  95.9792 },
			{ 922,	         1.961,	    227.526 },
			{ 706,	         4.417,	    529.691 },
			{ 650,	         6.174,	    202.253 },
			{ 628,	         6.111,	    309.278 },
			{ 487,	         6.040,	    853.196 },
			{ 479,	         4.988,	    522.577 },
			{ 468,	         4.617,	    63.736 },
			{ 417,	         2.117,	    323.505 },
			{ 408,	         1.299,	    209.367 },
			{ 352,	         2.317,	    632.784 },
			{ 344,	         3.959,	    412.371 },
			{ 340,	         3.634,	    316.392 },
			{ 336,	         3.772,	    735.877 },
			{ 332,	         2.861,	    210.118 },
			{ 289,	         2.733,	    117.320 },
			{ 281,	         5.744,	    2.448 },
			{ 266,	         0.543,	    647.011 },
			{ 230,	         1.644,	    216.480 },
			{ 192,	         2.965,	    224.345 },
			{ 173,	         4.077,	    846.083 },
			{ 167,	         2.597,	    21.341 },
			{ 136,	         2.286,	    10.295 },
			{ 131,	         3.441,	    742.990 },
			{ 128,	         4.095,	    217.231 },
			{ 109,	         6.161,	    415.552 },
			{ 98,	           4.73,	    838.97 },
			{ 94,	           3.48,	    1052.27 },
			{ 92,	           3.95,	    88.87 },
			{ 87,	           1.22,	    440.83 },
			{ 83,	           3.11,	    625.67 },
			{ 78,	           6.24,	    302.16 },
			{ 67,	           0.29,	    4.67 },
			{ 66,	           5.65,	    9.56 },
			{ 62,	           4.29,	    127.47 },
			{ 62,	           1.83,	    195.14 },
			{ 58,	           2.48,	    191.96 },
			{ 57,	           5.02,	    137.03 },
			{ 55,	           0.28,	    74.78 },
			{ 54,	           5.13,	    490.33 },
			{ 51,	           1.46,	    536.80 },
			{ 47,	           1.18,	    149.56 },
			{ 47,	           5.15,	    515.46 },
			{ 46,	           2.23,	    956.29 },
			{ 44,	           2.71,	    5.42 },
			{ 40,	           0.41,	    269.92 },
			{ 40,	           3.89,	    728.76 },
			{ 38,	           0.65,	    422.67 },
			{ 38,	           2.53,	    12.53 },
			{ 37,	           3.78,	    2.92 },
			{ 35,	           6.08,	    5.63 },
			{ 34,	           3.21,	    1368.66 },
			{ 33,	           4.64,	    277.03 },
			{ 33,	           5.43,	    1066.50 },
			{ 33,	           0.30,	    351.82 },
			{ 32,	           4.39,	    1155.36 },
			{ 31,	           2.43,	    52.69 },
			{ 30,	           2.84,	    203.00 },
			{ 30,	           6.19,	    284.15 },
			{ 30,	           3.39,	    1059.38 },
			{ 29,	           2.03,	    330.62 },
			{ 28,	           2.74,	    265.99 },
			{ 26,	           4.51,	    340.77 }
		},
		{ 
			{ 116441,	1.179879,	7.113547 },
			{ 91921,	0.07425,	213.29910 },
			{ 90592,	0,	      0 },
			{ 15277,	4.06492,	206.18555 },
			{ 10631,	0.25778,	220.41264 },
			{ 10605,	5.40964,	426.59819 },
			{ 4265,	  1.0460,	  14.2271 },
			{ 1216,	  2.9186,	  103.0928 },
			{ 1165,	  4.6094,	  639.8973 },
			{ 1082,	  5.6913,	  433.7117 },
			{ 1045,	  4.0421,	  199.0720 },
			{ 1020,	  0.6337,	  3.1814 },
			{ 634,	  4.388,	  419.485 },
			{ 549,	  5.573,	  3.932 },
			{ 457,	  1.268,	  110.206 },
			{ 425,	  0.209,	  227.526 },
			{ 274,	  4.288,	  95.979 },
			{ 162,	  1.381,	  11.046 },
			{ 129,	  1.566,	  309.278 },
			{ 117,	  3.881,	  853.196 },
			{ 105,	  4.900,	  647.011 },
			{ 101,	  0.893,	  21.341 },
			{ 96,	    2.91,	    316.39 },
			{ 95,	    5.63,	    412.37 },
			{ 85,	    5.73,	    209.37 },
			{ 83,	    6.05,	    216.48 },
			{ 82,	    1.02,	    117.32 },
			{ 75,	    4.76,	    210.12 },
			{ 67,	    0.46,	    522.58 },
			{ 66,	    0.48,	    10.29 },
			{ 64,	    0.35,	    323.51 },
			{ 61,	    4.88,	    632.78 },
			{ 53,	    2.75,	    529.69 },
			{ 46,	    5.69,	    440.83 },
			{ 45,	    1.67,	    202.25 },
			{ 42,	    5.71,	    88.87 },
			{ 32,	    0.07,	    63.74 },
			{ 32,	    1.67,	    302.16 },
			{ 31,	    4.16,	    191.96 },
			{ 27,	    0.83,	    224.34 },
			{ 25,	    5.66,	    735.88 },
			{ 20,	    5.94,	    217.23 },
			{ 18,	    4.90,	    625.67 },
			{ 17,	    1.63,	    742.99 },
			{ 16,	    0.58,	    515.46 },
			{ 14,	    0.21,	    838.97 },
			{ 14,	    3.76,	    195.14 },
			{ 12,	    4.72,	    203.00 },
			{ 12,	    0.13,	    234.64 },
			{ 12,	    3.12,	    846.08 },
			{ 11,	    5.92,	    536.80 },
			{ 11,	    5.60,	    728.76 },
			{ 11,	    3.20,	    1066.50 },
			{ 10,	    4.99,	    422.67 },
			{ 10,	    0.26,	    330.62 },
			{ 10,	    4.15,	    860.31 },
			{ 9,	    0.46,	    956.29 },
			{ 8,	    2.14,	    269.92 },
			{ 8,	    5.25,	    429.78 },
			{ 8,	    4.03,	    9.56 },
			{ 7,	    5.40,	    1052.27 },
			{ 6,	    4.46,	    284.15 },
			{ 6,	    5.93,	    405.26 }
		},
		{ 
			{ 16039,	5.73945,	7.11355 },
			{ 4250,	  4.5854,	  213.2991 },
			{ 1907,	  4.7608,	  220.4126 },
			{ 1466,	  5.9133,	  206.1855 },
			{ 1162,	  5.6197,	  14.2271 },
			{ 1067,	  3.6082,	  426.5982 },
			{ 239,	  3.861,	  433.712 },
			{ 237,	  5.768,	  199.072 },
			{ 166,	  5.116,	  3.181 },
			{ 151,	  2.736,	  639.897 },
			{ 131,	  4.743,	  227.526 },
			{ 63,	    0.23,	    419.48 },
			{ 62,	    4.74,	    103.09 },
			{ 40,	    5.47,	    21.34 },
			{ 40,	    5.96,	    95.98 },
			{ 39,	    5.83,	    110.21 }, 
			{ 28,	    3.01,	    647.01 }, 
			{ 25,	    0.99,	    3.93 },
			{ 19,	    1.92,	    853.20 }, 
			{ 18,	    4.97,	    10.29 },
			{ 18,	    1.03,	    412.37 },
			{ 18,	    4.20,	    216.48 },
			{ 18,	    3.32,	    309.28 }, 
			{ 16,	    3.90,	    440.83 }, 
			{ 16,	    5.62,	    117.32 }, 
			{ 13,	    1.18,	    88.87 }, 
			{ 11,	    5.58,	    11.05 }, 
			{ 11,	    5.93,	    191.96 }, 
			{ 10,	    3.95,	    209.37 }, 
			{ 9,	    3.39,	    302.16 }, 
			{ 8,	    4.88,	    323.51 }, 
			{ 7,	    0.38,	    632.78 }, 
			{ 6,	    2.25,	    522.58 }, 
			{ 6,	    1.06,	    210.12 }, 
			{ 5,	    4.64,	    234.64 }, 
			{ 4,	    3.14,	    0 },
			{ 4,	    2.31,	    515.46 },
			{ 3,	    2.20,	    860.31 }, 
			{ 3,	    0.59,	    529.69 }, 
			{ 3,	    4.93,	    224.34 }, 
			{ 3,	    0.42,	    625.67 }, 
			{ 2,	    4.77,	    330.62 }, 
			{ 2,	    3.35,	    429.78 }, 
			{ 2,	    3.20,	    202.25 }, 
			{ 2,	    1.19,	    1066.50 }, 
			{ 2,	    1.35,	    405.26 }, 
			{ 2,	    4.16,	    223.59 }, 
			{ 2,	    3.07,	    654.12 } 
		},
		{ 
			{ 1662,	3.9983,	7.1135 },
			{ 257,	2.984,	220.413 },
			{ 236,	3.902,	14.227 },
			{ 149,	2.741,	213.299 },
			{ 114,	3.142,	0 },
			{ 110,	1.515,	206.186 },
			{ 68,	  1.72,	  426.60  }, 
			{ 40,	  2.05,	  433.71 }, 
			{ 38,	  1.24,	  199.07 }, 
			{ 31,	  3.01,	  227.53 }, 
			{ 15,	  0.83,	  639.90 }, 
			{ 9,	  3.71,	  21.34 }, 
			{ 6,	  2.42,	  419.48 }, 
			{ 6,	  1.16,	  647.01 }, 
			{ 4,	  1.45,	  95.98 }, 
			{ 4,	  2.12,	  440.83 }, 
			{ 3,	  4.09,	  110.21 }, 
			{ 3,	  2.77,	  412.37 }, 
			{ 3,	  3.01,	  88.87 }, 
			{ 3,	  0.00,	  853.20 }, 
			{ 3,	  0.39,	  103.09 }, 
			{ 2,	  3.78,	  117.32 }, 
			{ 2,	  2.83,	  234.64 }, 
			{ 2,	  5.08,	  309.28 }, 
			{ 2,	  2.24,	  216.48 }, 
			{ 2,	  5.19,	  302.16 }, 
			{ 1,	  1.55,	  191.96 } 
		},
		{ 
			{ 124,	2.259,	7.114 },
			{ 34,	  2.16,	  14.23 },
			{ 28,	  1.20,	  220.41 },
			{ 6,	  1.22,	  227.53 },
			{ 5,	  0.24,	  433.71 },
			{ 4,	  6.23,	  426.60 },
			{ 3,	  2.97,	  199.07 },
			{ 3,	  4.29,	  206.19 },
			{ 2,	  6.25,	  213.30 },
			{ 1,	  5.28,	  639.90 },
			{ 1,	  0.24,	  440.83 },
			{ 1,	  3.14,	  0 }
		}
	};


	// Heliocentric latitude.
	private static final double[][][] SATURN_B = {
		{ 
			{ 4330678,	3.6028443,	213.2990954 },
			{ 240348,	  2.852385,	  426.598191 },
			{ 84746,	  0,	        0 },
			{ 34116,	  0.57297,	  206.18555 },
			{ 30863,	  3.48442,	  220.41264 },
			{ 14734,	  2.11847,	  639.89729 },
			{ 9917,	    5.7900,	    419.4846 },
			{ 6994,	    4.7360,	    7.1135 },
			{ 4808,	    5.4331,	    316.3919 },
			{ 4788,	    4.9651,	    110.2063 },
			{ 3432,	    2.7326,	    433.7117 },
			{ 1506,	    6.0130,	    103.0928 },
			{ 1060,	    5.6310,	    529.6910 },
			{ 969,	    5.204,	    632.784 },
			{ 942,	    1.396,	    853.196 },
			{ 708,	    3.803,	    323.505 },
			{ 552,	    5.131,	    202.253 },
			{ 400,	    3.359,	    227.526 },
			{ 319,	    3.626,	    209.367 },
			{ 316,	    1.997,	    647.011 },
			{ 314,	    0.465,	    217.231 },
			{ 284,	    4.886,	    224.345 },
			{ 236,	    2.139,	    11.046 },
			{ 215,	    5.950,	    846.083  },
			{ 209,	    2.120,	    415.552 },
			{ 207,	    0.730,	    199.072 },
			{ 179,	    2.954,	    63.736 },
			{ 141,	    0.644,	    490.334 },
			{ 139,	    4.595,	    14.227 },
			{ 139,	    1.998,	    735.877 },
			{ 135,	    5.245,	    742.990 },
			{ 122,	    3.115,	    522.577 },
			{ 116,	    3.109,	    216.480 },
			{ 114,	    0.963,	    210.118 }
		},
		{ 
			{ 397555,	5.332900,	213.299095 },
			{ 49479,	3.14159,	0 },
			{ 18572,	6.09919,	426.59819 },
			{ 14801,	2.30586,	206.18555 },
			{ 9644,	  1.6967,	  220.4126 },
			{ 3757,	  1.2543,	  419.4846 },
			{ 2717,	  5.9117,	  639.8973 },
			{ 1455,	  0.8516,	  433.7117 },
			{ 1291,	  2.9177,	  7.1135 },
			{ 853,	  0.436,	  316.392 },
			{ 298,	  0.919,	  632.784 },
			{ 292,	  5.316,	  853.196 },
			{ 284,	  1.619,	  227.526 },
			{ 275,	  3.889,	  103.093 },
			{ 172,	  0.052,	  647.011 },
			{ 166,	  2.444,	  199.072 },
			{ 158,	  5.209,	  110.206 },
			{ 128,	  1.207,	  529.691 },
			{ 110,	  2.457,	  217.231 },
			{ 82,	    2.76,	    210.12 },
			{ 81,	    2.86,	    14.23 },
			{ 69,	    1.66,	    202.25 },
			{ 65,	    1.26,	    216.48 },
			{ 61,	    1.25,	    209.37 },
			{ 59,	    1.82,	    323.51 },
			{ 46,	    0.82,	    440.83 },
			{ 36,	    1.82,	    224.34 },
			{ 34,	    2.84,	    117.32 },
			{ 33,	    1.31,	    412.37 },
			{ 32,	    1.19,	    846.08 },
			{ 27,	    4.65,	    1066.50 },
			{ 27,	    4.44,	    11.05 }
		},
		{ 
			{ 20630,	0.50482,	213.29910 }, 
			{ 3720,	  3.9983,	  206.1855 },
			{ 1627,	  6.1819,	  220.4126 },
			{ 1346,	  0,	      0 },
			{ 706,	  3.039,	  419.485 },
			{ 365,	  5.099,	  426.598 },
			{ 330,	  5.279,	  433.712 },
			{ 219,	  3.828,	  639.897 },
			{ 139,	  1.043,	  7.114 },
			{ 104,	  6.157,	  227.526 },
			{ 93,	    1.98,	    316.39 },
			{ 71,	    4.15,	    199.07 },
			{ 52,	    2.88,	    632.78 },
			{ 49,	    4.43,	    647.01 },
			{ 41,	    3.16,	    853.20 },
			{ 29,	    4.53,	    210.12 },
			{ 24,	    1.12,	    14.23 },
			{ 21,	    4.35,	    217.23 },
			{ 20,	    5.31,	    440.83 },
			{ 18,	    0.85,	    110.21 },
			{ 17,	    5.68,	    216.48 },
			{ 16,	    4.26,	    103.09 },
			{ 14,	    3.00,	    412.37 },
			{ 12,	    2.53,	    529.69 },
			{ 8,	    3.32,	    202.25 },
			{ 7,	    5.56,	    209.37 },
			{ 7,	    0.29,	    323.51 },
			{ 6,	    1.16,	    117.32 },
			{ 6,	    3.61,	    869.31 }
		},
		{ 
			{ 666,	1.990,	213.299 },
			{ 632,	5.698,	206.186 },
			{ 398,	0,	    0 },
			{ 188,	4.338,	220.413 },
			{ 92,	  4.84,	  419.48 },
			{ 52,	  3.42,	  433.71 },
			{ 42,	  2.38,	  426.60 },
			{ 26,	  4.40,	  227.53 },
			{ 21,	  5.85,	  199.07 },
			{ 18,	  1.99,	  639.90 },
			{ 11,	  5.37,	  7.11 },
			{ 10,	  2.55,	  647.01 },
			{ 7,	  3.46,	  316.39 },
			{ 6,	  4.80,	  632.78 },
			{ 6,	  0.02,	  210.12 },
			{ 6,	  3.52,	  440.83 },
			{ 5,	  5.64,	  14.23 },
			{ 5,	  1.22,	  853.20 },
			{ 4,	  4.71,	  412.37 },
			{ 3,	  0.63,	  103.09 },
			{ 2,	  3.72,	  216.48 } 
		},
		{ 
			{ 80,	1.12,	206.19 },
			{ 32,	3.12,	213.30 },
			{ 17,	2.48,	220.41 },
			{ 12,	3.14,	0 },
			{ 9,	0.38,	419.48 },
			{ 6,	1.56,	433.71 },
			{ 5,	2.63,	227.53 },
			{ 5,	1.28,	199.07 },
			{ 1,	1.43,	426.60 },
			{ 1,	0.67,	647.01 },
			{ 1,	1.72,	440.83 },
			{ 1,	6.18,	639.90 }
		},
		{ 
			{ 8,	2.82,	206.19 },
			{ 1,	0.51,	220.41 }
		}
	};


	// Heliocentric radius vector.
	private static final double[][][] SATURN_R = {
		{ 
			{ 955758136,	  0,	        0 },
			{ 52921382,	    2.39226220,	213.29909544 },
			{ 1873680,	    5.2354961,	206.1855484 },
			{ 1464664,	    1.6476305,	426.5981909 },
			{ 821891,	      5.935200,	  316.391870 },
			{ 547507,	      5.015326,	  103.092774 },
			{ 371684,	      2.271148,	  220.412642 },
			{ 361778,       3.139043,	  7.113547 },
			{ 140618,	      5.704067,	  632.783739 },
			{ 108975,	      3.293136,	  110.206321 },
			{ 69007,	      5.94100,	  419.48464 },
			{ 61053,	      0.94038,	  639.89729 },
			{ 48913,	      1.55733,	  202.25340 },
			{ 34144,	      0.19519,	  277.03499 },
			{ 32402,	      5.47085,	  949.17561 },
			{ 20937,	      0.46349,	  735.87651 },
			{ 20839,	      1.52103,	  433.71174 },
			{ 20747,	      5.33256,	  199.07200 },
			{ 15298,	      3.05944,	  529.69097 },
			{ 14296,	      2.60434,	  323.50542 },
			{ 12884,	      1.64892,	  138.51750 },
			{ 11993,	      5.98051,	  846.08283 },
			{ 11380,	      1.73106,	  522.57742 },
			{ 9796,	        5.2048,	    1265.5675 },
			{ 7753,	        5.8519,	    95.9792 },
			{ 6771,	        3.0043,	    14.2271 },
			{ 6466,	        0.1773,	    1052.2684 },
			{ 5850,	        1.4552,	    415.5525 },
			{ 5307,	        0.5974,	    63.7359 },
			{ 4696,	        2.1492,	    227.5262 },
			{ 4044,	        1.6401,	    209.3669 },
			{ 3688,	        0.7802,	    412.3711 },
			{ 3461,	        1.8509,	    175.1661 },
			{ 3420,	        4.9455,	    1581.9593 },
			{ 3401,	        0.5539,	    350.3321 },
			{ 3376,	        3.6953,	    224.3448 },
			{ 2976,	        5.6847,	    210.1177 },
			{ 2885,	        1.3876,	    838.9693 },
			{ 2881,	        0.1796,	    853.1964 },
			{ 2508,	        3.5385,	    742.9901 },
			{ 2448,	        6.1841,	    1368.6603 },
			{ 2406,	        2.9656,	    117.3199 },
			{ 2174,	        0.0151,	    340.7709 },
			{ 2024,	        5.0541,	    11.0457 } 
		},
		{ 
			{ 6182981,	0.2584352,	213.2990954 },
			{ 506578,	  0.711147,	  206.185548 },
			{ 341394,	  5.796358,	  426.598191 },
			{ 188491,	  0.472157,	  220.412642 },
			{ 186262,	  3.141593,	  0 },
			{ 143891,	  1.407449, 	7.113547 }, 
			{ 49621,	  6.01744,  	103.09277 },
			{ 20928,	  5.09246,  	639.89729 },
			{ 19953,	  1.17560,  	419.48464 },
			{ 18840,	  1.60820,  	110.20632 },
			{ 13877,	  0.75886,  	199.07200 },
			{ 12893,	  5.94330,  	433.71174 },
			{ 5397,	    1.2885,	    14.2271 },
			{ 4869,	    0.8679,	    323.5054 },
			{ 4247,	    0.3930,	    227.5262 },
			{ 3252,	    1.2585,	    95.9792 },
			{ 3081,	    3.4366,	    522.5774 },
			{ 2909,	    4.6068,	    202.2534 },
			{ 2856,	    2.1673,	    735.8765 },
			{ 1988,	    2.4505,	    412.3711 },
			{ 1941,	    6.0239,	    209.3669 },
			{ 1581,	    1.2919,	    210.1177 },
			{ 1340,	    4.3080,	    853.1964 },
			{ 1316,	    1.2530,	    117.3199 },
			{ 1203,	    1.8665,	    316.3919 },
			{ 1091,	    0.0753,	    216.4805 },
			{ 966,	    0.480,	    632.784 },
			{ 954,	    5.152,	    647.011 },
			{ 898,	    0.983,	    529.691 },
			{ 882,	    1.885,	    1052.268 },
			{ 874,	    1.402,	    224.345 },
			{ 785,	    3.064,	    838.969 },
			{ 740,	    1.382,	    625.670 },
			{ 658,	    4.144,	    309.278 },
			{ 650,	    1.725,	    742.990 },
			{ 613,	    3.033,	    63.736 },
			{ 599,	    2.549,	    217.231 },
			{ 503,	    2.130,	    3.932 }
		},
		{ 
			{ 436902,	4.786717,	213.299095 },
			{ 71923,	2.50070,	206.18555 },
			{ 49767,	4.97168,	220.41264 },
			{ 43221,	3.86940,	426.59819 },
			{ 29646,	5.96310,	7.11355 },
			{ 4721,	  2.4753,	  199.0720 },
			{ 4142,	  4.1067,	  433.7117 },
			{ 3789,	  3.0977,	  639.8973 },
			{ 2964,	  1.3721,	  103.0928 },
			{ 2556,	  2.8507,	  419.4846 },
			{ 2327,	  0,	      0 },
			{ 2208,	  6.2759,	  110.2063 },
			{ 2188,	  5.8555,	  14.2271 },
			{ 1957,	  4.9245,	  227.5262 },
			{ 924,	  5.464,	  323.505 },
			{ 706,	  2.971,	  95.979 },
			{ 546,	  4.129,	  412.371 },
			{ 431,	  5.178,	  522.577 },
			{ 405,	  4.173,	  209.367 },
			{ 391,	  4.481,	  216.480 },
			{ 374,	  5.834,	  117.320 },
			{ 361,	  3.277,	  647.011 },
			{ 356,	  3.192,	  210.118 },
			{ 326,	  2.269,	  853.196 },
			{ 207,	  4.022,	  735.877 },
			{ 204,	  0.088,	  202.253 },
			{ 180,	  3.597,	  632.784 },
			{ 178,	  4.097,	  440.825 },
			{ 154,	  3.135,	  625.670 },
			{ 148,	  0.136,	  302.165 },
			{ 133,	  2.594,	  191.958 },
			{ 132,	  5.933,	  309.278 }
		},
		{ 
			{ 20315,	3.02187,	213.29910 },
			{ 8924,	  3.1914, 	220.4126 },
			{ 6909,	  4.3517, 	206.1855 },
			{ 4087,	  4.2241, 	7.1135 },
			{ 3879,	  2.0106, 	426.5982 },
			{ 1071,	  4.2036, 	199.0720 },
			{ 907,	  2.283,  	433.712 },
			{ 606,	  3.175,  	227.526 },
			{ 597,	  4.135,  	14.227 },
			{ 483,	  1.173,  	639.897 },
			{ 393,	  0,      	0 },
			{ 229,	  4.698,	  419.485 }, 
			{ 188,	  4.590,	  110.206 },
			{ 150,	  3.202,	  103.093 },
			{ 121,	  3.768,	  323.505 },
			{ 102,	  4.710,	  95.979 },
			{ 101,	  5.819,	  412.371 },
			{ 93,	    1.44,	    647.01 },
			{ 84,	    2.63,	    216.48 },
			{ 73,	    4.15,	    117.32 },
			{ 62,	    2.31,	    440.83 },
			{ 55,	    0.31,	    853.20 },
			{ 50,	    2.39,	    209.37 },
			{ 45,	    4.37,	    191.96 },
			{ 41,	    0.69,	    522.58 },
			{ 40,	    1.84,	    302.16 },
			{ 38,	    5.94,	    88.87 },
			{ 32,	    4.01,	    21.34 }                     
		},
		{ 
			{ 1202,	1.4150,	220.4126 },
			{ 708,	1.162,	213.299 },
			{ 516,	6.240,	206.186 },
			{ 427,	2.469,	7.114 },
			{ 268,	0.187,	426.598 },
			{ 170,	5.959,	199.072 },
			{ 150,	0.480,	433.712 },
			{ 145,	1.442,	227.526 },
			{ 121,	2.405,	14.227 },
			{ 47,	  5.57,	  639.90 },
			{ 19,	  5.86,	  647.01 },
			{ 17,	  0.53,	  440.83 },
			{ 16,	  2.90,	  110.21 },
			{ 15,	  0.30,	  419.48 },
			{ 14,	  1.30,	  412.37 },
			{ 13,	  2.09,	  323.51 },
			{ 11,	  0.22,	  95.98 },
			{ 11,	  2.46,	  117.32 },
			{ 10,	  3.14,	  0 },
			{ 9,	  1.56,	  88.87 },
			{ 9,	  2.28,	  21.34 },
			{ 9,	  0.68,	  216.48 },
			{ 8,	  1.27,	  234.64 }
		},
		{ 
			{ 129,	5.913,	220.413 },
			{ 32,	  0.69,	  7.11 },
			{ 27,	  5.91,	  227.53 },
			{ 20,	  4.95,	  433.71 },
			{ 20,	  0.67,	  14.23 },
			{ 14,	  2.67,	  206.19 },
			{ 14,	  1.46,	  199.07 },
			{ 13,	  4.59,	  426.60 },
			{ 7,	  4.63,	  213.30 },
			{ 5,	  3.61,	  639.90 },
			{ 4,	  4.90,	  440.83 },
			{ 3,	  4.07,	  647.01 },
			{ 3,	  4.66,	  191.96 },
			{ 3,	  0.49,	  323.51 },
			{ 3,	  3.18,	  419.48 },
			{ 2,	  3.70,	  88.87 },
			{ 2,	  3.32,	  95.98 },
			{ 2,	  0.56,	  117.32 }
		}
	};

	/**
	 * Tables of Vsop87 terms for Saturn.
	 */
	static Vsop87 SATURN = new Vsop87(SATURN_L, SATURN_B, SATURN_R);


	// ******************************************************************** //
	// Uranus.
	// ******************************************************************** //

	// Heliocentric ecliptical longitude.
	private static final double[][][] URANUS_L = {
		{ 
			{ 548129294,	0,        	0 },
			{ 9260408,	  0.8910642,	74.7815986 },
			{ 1504248,    3.6271926,	1.4844727 },
			{ 365982,   	1.899622,	  73.297126 },
			{ 272328,   	3.358237,	  149.563197 },
			{ 70328,  	  5.39254,	  63.73590 },
			{ 68893, 	    6.09292,	  76.26607 },
			{ 61999, 	    2.26952,	  2.96895 },
			{ 61951, 	    2.85099,	  11.04570 },
			{ 26469, 	    3.14152,	  71.81265 },
			{ 25711, 	    6.11380,	  454.90937 },
			{ 21079,	    4.36059,	  148.07872 },
			{ 17819, 	    1.74437,	  36.64856 },
			{ 14613,	    4.73732,	  3.93215 },
			{ 11163, 	    5.82682,	  224.34480 },
			{ 10998,	    0.48865,	  138.51750 },
			{ 9527,	      2.9552,	    35.1641 },
			{ 7546,	      5.2363,	    109.9457 },
			{ 4220,	      3.2333,	    70.8494 },
			{ 4052,	      2.2775,	    151.0477 },
			{ 3490, 	    5.4831,	    146.5943 },
			{ 3355,	      1.0655,	    4.4534 },
			{ 3144,  	    4.7520,	    77.7505 },
			{ 2927,	      4.6290,	    9.5612 },
			{ 2922,	      5.3524,	    85.8273 },
			{ 2273,  	    4.3660,	    70.3282 },
			{ 2149,	      0.6075,	    38.1330 },
			{ 2051,  	    1.5177,	    0.1119 },
			{ 1992,  	    4.9244,	    277.0350 },
			{ 1667,	      3.6274,	    380.1278 },
			{ 1533,  	    2.5859,	    52.6902 },
			{ 1376,	      2.0428,	    65.2204 },
			{ 1372,	      4.1964,	    111.4302 }, 
			{ 1284,  	    3.1135,	    202.2534 },
			{ 1282,	      0.5427,	    222.8603 },
			{ 1244,	      0.9161,	    2.4477 },
			{ 1221,	      0.1990,	    108.4612 },
			{ 1151,	      4.1790,	    33.6796 },
			{ 1150,	      0.9334,	    3.1814 },
			{ 1090,	      1.7750,	    12.5302 },
			{ 1072,	      0.2356,	    62.2514 },
			{ 946,	      1.192,	    127.472 },
			{ 708,	      5.183,	    213.299 },
			{ 653,	      0.966,	    78.714 },
			{ 628,	      0.182,	    984.600 },
			{ 607,	      5.432,	    529.691 },
			{ 559,	      3.358,	    0.521 },
			{ 524,	      2.013,	    299.126 },
			{ 483,	      2.106,	    0.963 },
			{ 471,	      1.407,	    184.727 },
			{ 467,	      0.415,	    145.110 },
			{ 434,	      5.521,	    183.243 },
			{ 405,	      5.987,	    8.077 },
			{ 399,	      0.338,	    415.552 },
			{ 396,	      5.870,	    351.817 },
			{ 379,	      2.350,	    56.622 },
			{ 310,	      5.833,	    145.631 },
			{ 300,	      5.644,	    22.091 },
			{ 294,	      5.839,	    39.618 },
			{ 252,	      1.637,	    221.376 },
			{ 249,	      4.746,	    225.829 },
			{ 239,	      2.350,	    137.033 },
			{ 224,        0.516,	    84.343 },
			{ 223,	      2.843,	    0.261 },
			{ 220,	      1.922,	    67.668 },
			{ 217,	      6.142,	    5.938 },
			{ 216,	      4.778,	    340.771 },
			{ 208,        5.580,	    68.844 },
			{ 202,	      1.297,	    0.048 }, 
			{ 199,	      0.956,	    152.532 },
			{ 194,	      1.888,	    456.394 },
			{ 193,	      0.916,	    453.425 } ,
			{ 187,        1.319,	    0.160 },
			{ 182,	      3.536,	    79.235 }, 
			{ 173,	      1.539,	    160.609 },
			{ 172,	      5.680,	    219.891 },
			{ 170,	      3.677,    	5.417 },
			{ 169,	      5.879,	    18.159 },
			{ 165,	      1.424,	    106.977 },
			{ 163,	      3.050,	    112.915 },
			{ 158,	      0.738,	    54.175 },
			{ 147,	      1.263,	    59.804 },
			{ 143,	      1.300,	    35.425 },
			{ 139,	      5.386,	    32.195 },
			{ 139,	      4.260,	    909.819 },
			{ 124,        1.374,	    7.114 },
			{ 110,	      2.027,	    554.070 },
			{ 109,	      5.706,	    77.963 },
			{ 104,	      5.028,	    0.751 },
			{ 104,	      1.458,	    24.379 },
			{ 103,        0.681,	    14.978 }
		},
		{ 
			{ 7502543122.0,	0,	      0 },
			{ 154458,   	  5.242017,	74.781599 },
			{ 24456,	      1.71256,	1.48447 },
			{ 9258,	        0.4284,	  11.0457 },
			{ 8266,	        1.5022,	  63.7359 },
			{ 7842,	        1.3198,	  149.5632 },
			{ 3899,	        0.4648,	  3.9322 },
			{ 2284,	        4.1737,	  76.2661 },
			{ 1927,	        0.5301,	  2.9689 },
			{ 1233,	        1.5863,	  70.8494 },
			{ 791,	        5.436,	  3.181 }, 
			{ 767,	        1.996,	  73.297  },
			{ 482,	        2.984,	  85.827  },
			{ 450,	        4.138,	  138.517  },
			{ 446,	        3.723,	  224.345  },
			{ 427,	        4.731,	  71.813  },
			{ 354,	        2.583,	  148.079  },
			{ 348,	        2.454,	  9.561  },
			{ 317,	        5.579,	  52.690  },
			{ 206,	        2.363,	  2.448  },
			{ 189,	        4.202,	  56.622  },
			{ 184,	        0.284,	  151.048  },
			{ 180,	        5.684,	  12.530  },
			{ 171,	        3.001,	  78.714  },
			{ 158,	        2.909,	  0.963  },
			{ 155,	        5.591,	  4.453  },
			{ 154,	        4.652,	  35.164  },
			{ 152,	        2.942,	  77.751  },
			{ 143,	        2.590,	  62.251  },
			{ 121,	        4.148,	  127.472  },
			{ 116,	        3.732,	  65.220  },
			{ 102,	        4.188,	  145.631  },
			{ 102,	        6.034,	  0.112  },
			{ 88,	          3.99,	    18.16  },
			{ 88,	          6.16,	    202.25  },
			{ 81,	          2.64,	    22.09  },
			{ 72,	          6.05,	    70.33  },
			{ 69,	          4.05,	    77.96  },
			{ 59,	          3.70,	    67.67  },
			{ 47,	          3.54,	    351.82  },
			{ 44,	          5.91,	    7.11  },
			{ 43,	          5.72,	    5.42  },
			{ 39,	          4.92,	    222.86  },
			{ 36,	          5.90,	    33.68  },
			{ 36,	          3.29,	    8.08  },
			{ 36,	          3.33,	    71.60  },
			{ 35,	          5.08,	    38.13  },
			{ 31,	          5.62,	    984.60  },
			{ 31,	          5.50,	    59.80  },
			{ 31,	          5.46,	    160.61  },
			{ 30,	          1.66,	    447.80  },
			{ 29,	          1.15,	    462.02  },
			{ 29,	          4.52,	    84.34  },
			{ 27,	          5.54,	    131.40  },
			{ 27,	          6.15,	    299.13  },
			{ 26,	          4.99,	    137.03  },
			{ 25,	          5.74,	    380.13  }
		},
		{ 
			{ 53033,  0,      0 },
			{ 2358,   2.2601, 74.7816 },
			{ 769,    4.526,  11.046 },
			{ 552,    3.258,  63.736 },
			{ 542,    2.276,  3.932 },
			{ 529,    4.923,  1.484 },
			{ 258,    3.691,  3.181 },
			{ 239,    5.858,  149.563 },
			{ 182,    6.218,  70.849 },
			{ 54,     1.44,   76.27 },
			{ 49,     6.03,   56.62 },
			{ 45,     3.91,   2.45 },
			{ 45,     0.81,   85.83 },
			{ 38,     1.78,   52.69 },
			{ 37,     4.46,   2.97 },
			{ 33,     0.86,   9.56 },
			{ 29,     5.10,   73.30 },
			{ 24,     2.11,   18.16 },
			{ 22,     5.99,   138.52 },
			{ 22,     4.82,   78.71 },
			{ 21,     2.40,   77.96 },
			{ 21,     2.17,   224.34 },
			{ 17,     2.54,   145.63 },
			{ 17,     3.47,   12.53 },
			{ 12,     0.02,   22.09 },
			{ 11,     0.08,   127.47 },
			{ 10,     5.16,   71.60 },
			{ 10,     4.46,   62.25 },
			{ 9,      4.26,   7.11 },
			{ 8,      5.50,   67.67 },
			{ 7,      1.25,   5.42 },
			{ 6,      3.36,   447.80 },
			{ 6,      5.45,   65.22 },
			{ 6,      4.52,   151.05 },
			{ 6,      5.73,   462.02 }
		},
		{ 
			{ 121,  0.024,  74.782 },
			{ 68,   4.12,   3.93 },
			{ 53,   2.39,   11.05 },
			{ 46,   0,      0 },
			{ 45,   2.04,   3.18 },
			{ 44,   2.96,   1.48 },
			{ 25,   4.89,   63.74 },
			{ 21,   4.55,   70.85 },
			{ 20,   2.31,   149.56 },
			{ 9,    1.58,   56.62 },
			{ 4,    0.23,   18.16 },
			{ 4,    5.39,   76.27 },
			{ 4,    0.95,   77.96 },
			{ 3,    4.98,   85.83 },
			{ 3,    4.13,   52.69 },
			{ 3,    0.37,   78.71 },
			{ 2,    0.86,   145.63 },
			{ 2,    5.66,   9.56 }
		},
		{ 
			{ 114,  3.142,  0 },
			{ 6,    4.58,   74.78 },
			{ 3,    0.35,   11.05 },
			{ 1,    3.42,   56.62 }
		}
	};


	// Heliocentric latitude.
	private static final double[][][] URANUS_B = {
		{ 
			{ 1346278,  2.6187781,  74.7815986 },
			{ 62341,    5.08111,    149.56320 },
			{ 61601,    3.14159,    0 },
			{ 9964,     1.6160,     76.2661 },
			{ 9926,     0.5763,     73.2971 },
			{ 3259,     1.2612,     224.3448 },
			{ 2972,     2.2437,     1.4845 },
			{ 2010,     6.0555,     148.0787 },
			{ 1522,     0.2796,     63.7359 },
			{ 924,      4.038,      151.048 },
			{ 761,      6.140,      71.813 },
			{ 522,      3.321,      138.517 },
			{ 463,      0.743,      85.827 },
			{ 437,      3.381,      529.691 },
			{ 435,      0.341,      77.751 },
			{ 431,      3.554,      213.299 },
			{ 420,      5.213,      11.046 },
			{ 245,      0.788,      2.969 },
			{ 233,      2.257,      222.860 },
			{ 216,      1.591,      38.133 },
			{ 180,      3.725,      299.126 },
			{ 175,      1.236,      146.594 },
			{ 174,      1.937,      380.128 },
			{ 160,      5.336,      111.430 },
			{ 144,      5.962,      35.164 },
			{ 116,      5.739,      70.849 },
			{ 106,      0.941,      70.328 },
			{ 102,      2.619,      78.714 }
		},
		{ 
			{ 206366, 4.123943, 74.781599 },
			{ 8563,   0.3382,   149.5632 },
			{ 1726,   2.1219,   73.2971 },
			{ 1374,   0,        0 },
			{ 1369,   3.0686,   76.2661 },
			{ 451,    3.777,    1.484 },
			{ 400,    2.848,    224.345 },
			{ 307,    1.255,    148.079 },
			{ 154,    3.786,    63.736 },
			{ 112,    5.573,    151.048 },
			{ 111,    5.329,    138.517 },
			{ 83,     3.59,     71.81 },
			{ 56,     3.40,     85.83 },
			{ 54,     1.70,     77.75 },
			{ 42,     1.21,     11.05 },
			{ 41,     4.45,     78.71 },
			{ 32,     3.77,     222.86 },
			{ 30,     2.56,     2.97 },
			{ 27,     5.34,     213.30 },
			{ 26,     0.42,     380.13 }
		},
		{ 
			{ 9212, 5.8004, 74.7816 },
			{ 557,  0,      0},
			{ 286,  2.177,  149.563 },
			{ 95,   3.84,   73.30 },
			{ 45,   4.88,   76.27 },
			{ 20,   5.46,   1.48 },
			{ 15,   0.88,   138.52 },
			{ 14,   2.85,   148.08 },
			{ 14,   5.07,   63.74 },
			{ 10,   5.00,   224.34 },
			{ 8,    6.27,   78.71 }
		},
		{ 
			{ 268,  1.251,  74.782 },
			{ 11,   3.14,   0 },
			{ 6,    4.01,   149.56 },
			{ 3,    5.78,   73.30 }
		},
		{ 
			{ 6,  2.85, 74.78 }
		}
	};


	// Heliocentric radius vector.
	private static final double[][][] URANUS_R = {
		{ 
			{ 1921264848,   0,          0 },
			{ 88784984,     5.60377527, 74.78159857 },
			{ 3440836,      0.3283610,  73.2971259 },
			{ 2055653,      1.7829517,  149.5631971 },
			{ 649322,       4.522473,   76.266071 },
			{ 602248,       3.860038,   63.735898 },
			{ 496404,       1.401399,   454.909367 },
			{ 338526,       1.580027,   138.517497 },
			{ 243508,       1.570866,   71.812653 },
			{ 190522,       1.998094,   1.484473 },
			{ 161858,       2.791379,   148.078724 },
			{ 143706,       1.383686,   11.045700 },
			{ 93192,        0.17437,    36.64856 },
			{ 89806,        3.66105,    109.94569 },
			{ 71424,        4.24509,    224.34480 },
			{ 46677,        1.39977,    35.16409 },
			{ 39026,        3.36235,    277.03499 },
			{ 39010,        1.66971,    70.84945 },
			{ 36755,        3.88649,    146.59425 },
			{ 30349,        0.70100,    151.04767 },
			{ 29156,        3.18056,    77.75054 },
			{ 25786,        3.78538,    85.82730 },
			{ 25620,        5.25656,    380.12777 },
			{ 22637,        0.72519,    529.69097 },
			{ 20473,        2.79640,    70.32818 },
			{ 20472,        1.55589,    202.25340 },
			{ 17901,        0.55455,    2.96895 },
			{ 15503,        5.35405,    38.13304 },
			{ 14702,        4.90434,    108.46122 },
			{ 12897,        2.62154,    111.43016 },
			{ 12328,        5.96039,    127.47180 },
			{ 11959,        1.75044,    984.60033 },
			{ 11853,        0.99343,    52.69020 },
			{ 11696,        3.29826,    3.93215 },
			{ 11495,        0.43774,    65.22037 },
			{ 10793,        1.42105,    213.29910 },
			{ 9111,         4.9964,     62.2514 },
			{ 8421,         5.2535,     222.8603 },
			{ 8402,         5.0388,     415.5525 },
			{ 7449,         0.7949,     351.8166 },
			{ 7329,         3.9728,     183.2428 },
			{ 6046,         5.6796,     78.7138 },
			{ 5524,         3.1150,     9.5612 },
			{ 5445,         5.1058,     145.1098 },
			{ 5238,         2.6296,     33.6796 },
			{ 4079,         3.2206,     340.7709 },
			{ 3919,         4.2502,     39.6175 },
			{ 3802,         6.1099,     184.7273 },
			{ 3781,         3.4584,     456.3938 },
			{ 3687,         2.4872,     453.4249 },
			{ 3102,         4.1403,     219.8914 },
			{ 2963,         0.8298,     56.6224 },
			{ 2942,         0.4239,     299.1264 },
			{ 2940,         2.1464,     137.0330 },
			{ 2938,         3.6766,     140.0020 },
			{ 2865,         0.3100,     12.5302 },
			{ 2538,         4.8546,     131.4039 },
			{ 2364,         0.4425,     554.0700 },
			{ 2183,         2.9404,     305.3462 }
		},
		{ 
			{ 1479896,  3.6720571,  74.7815986 },
			{ 71212,    6.22601,    63.73590 },
			{ 68627,    6.13411,    149.56320 },
			{ 24060,    3.14159,    0 },
			{ 21468,    2.60177,    76.26607 },
			{ 20857,    5.24625,    11.04570 },
			{ 11405,    0.01848,    70.84945 },
			{ 7497,     0.4236,     73.2971 },
			{ 4244,     1.4169,     85.8273 },
			{ 3927,     3.1551,     71.8127 },
			{ 3578,     2.3116,     224.3448 },
			{ 3506,     2.5835,     138.5175 },
			{ 3229,     5.2550,     3.9322 },
			{ 3060,     0.1532,     1.4845 },
			{ 2564,     0.9808,     148.0787 },
			{ 2429,     3.9944,     52.6902 },
			{ 1645,     2.6535,     127.4718 },
			{ 1584,     1.4305,     78.7138 },
			{ 1508,     5.0600,     151.0477 },
			{ 1490,     2.6756,     56.6224 },
			{ 1413,     4.5746,     202.2534 },
			{ 1403,     1.3699,     77.7505 },
			{ 1228,     1.0470,     62.2514 },
			{ 1033,     0.2646,     131.4039 },
			{ 992,      2.172,      65.220 },
			{ 862,      5.055,      351.817 },
			{ 744,      3.076,      35.164 },
			{ 687,      2.499,      77.963 },
			{ 647,      4.473,      70.328 },
			{ 624,      0.863,      9.561 },
			{ 604,      0.907,      984.600 },
			{ 575,      3.231,      447.796 },
			{ 562,      2.718,      462.023 },
			{ 530,      5.917,      213.299 },
			{ 528,      5.151,      2.969 }
		},
		{ 
			{ 22440,  0.69953,  74.78160 },
			{ 4727,   1.6990,   63.7359 },
			{ 1682,   4.6483,   70.8494 },
			{ 1650,   3.0966,   11.0457 },
			{ 1434,   3.5212,   149.5632 },
			{ 770,    0,        0 },
			{ 500,    6.172,    76.266 },
			{ 461,    0.767,    3.932 },
			{ 390,    4.496,    56.622 },
			{ 390,    5.527,    85.827 },
			{ 292,    0.204,    52.690 },
			{ 287,    3.534,    73.297 },
			{ 273,    3.847,    138.517 },
			{ 220,    1.964,    131.404 },
			{ 216,    0.848,    77.963 },
			{ 205,    3.248,    78.714 },
			{ 149,    4.898,    127.472 },
			{ 129,    2.081,    3.181 }
		},
		{ 
			{ 1164,   4.7345, 74.7816 },
			{ 212,    3.343,  63.736 },
			{ 196,    2.980,  70.849 },
			{ 105,    0.958,  11.046 },
			{ 73,     1.00,   149.56 },
			{ 72,     0.03,   56.62 },
			{ 55,     2.59,   3.93 },
			{ 36,     5.65,   77.96 },
			{ 34,     3.82,   76.27 },
			{ 32,     3.60,   131.40 }
		},
		{ 
			{ 53, 3.01, 74.78 },
			{ 10, 1.91, 56.62 }
		}
	};

	/**
	 * Tables of Vsop87 terms for Uranus.
	 */
	static Vsop87 URANUS = new Vsop87(URANUS_L, URANUS_B, URANUS_R);


	// ******************************************************************** //
	// Neptune.
	// ******************************************************************** //

	// Heliocentric ecliptical longitude.
	private static final double[][][] NEPTUNE_L = {
		{ 
			{ 531188633,  0,          0 },
			{ 1798476,    2.9010127,  38.1330356 },
			{ 1019728,    0.4858092,  1.4844727 },
			{ 124532,     4.830081,   36.648563 },
			{ 42064,      5.41055,    2.96895 },
			{ 37715,      6.09222,    35.16409 },
			{ 33785,      1.24489,    76.26607 },
			{ 16483,      0.00008,    491.55793 },
			{ 9199,       4.9375,     39.6175 },
			{ 8994,       0.2746,     175.1661 },
			{ 4216,       1.9871,     73.2971 },
			{ 3365,       1.0359,     33.6796 },
			{ 2285,       4.2061,     4.4534 },
			{ 1434,       2.7834,     74.7816 },
			{ 900,        2.076,      109.946 },
			{ 745,        3.190,      71.813 },
			{ 506,        5.748,      114.399 },
			{ 400,        0.350,      1021.249 },
			{ 345,        3.462,      41.102 },
			{ 340,        3.304,      77.751 },
			{ 323,        2.248,      32.195 },
			{ 306,        0.497,      0.521 },
			{ 287,        4.505,      0.048 },
			{ 282,        2.246,      146.594 },
			{ 267,        4.889,      0.963 },
			{ 252,        5.782,      388.465 },
			{ 245,        1.247,      9.561 },
			{ 233,        2.505,      137.033 },
			{ 227,        1.797,      453.425 },
			{ 170,        3.324,      108.461 },
			{ 151,        2.192,      33.940 },
			{ 150,        2.997,      5.938 },
			{ 148,        0.859,      111.430 },
			{ 119,        3.677,      2.448 },
			{ 109,        2.416,      183.243 },
			{ 103,        0.041,      0.261 },
			{ 103,        4.404,      70.328 },
			{ 102,        5.705,      0.112 } 
		},
		{ 
			{ 3837687717.0, 0,        0 },
			{ 16604,        4.86319,  1.48447 },
			{ 15807,        2.27923,  38.13304 },
			{ 3335,         3.6820,   76.2661 },
			{ 1306,         3.6732,   2.9689 },
			{ 605,          1.505,    35.164 },
			{ 179,          3.453,    39.618 },
			{ 107,          2.451,    4.453 },
			{ 106,          2.755,    33.680 },
			{ 73,           5.49,     36.65 },
			{ 57,           1.86,     114.40 },
			{ 57,           5.22,     0.52 },
			{ 35,           4.52,     74.78 },
			{ 32,           5.90,     77.75 },
			{ 30,           3.67,     388.47 },
			{ 29,           5.17,     9.56 },
			{ 29,           5.17,     2.45 },
			{ 26,           5.25,     168.05 }
		},
		{ 
			{ 53893,  0,    0 },
			{ 296,  1.855,  1.484 },
			{ 281,  1.191,  38.133 },
			{ 270,  5.721,  76.266 },
			{ 23,   1.21,   2.97 },
			{ 9,    4.43,   35.16 },
			{ 7,    0.54,   2.45 }
		},
		{ 
			{ 31, 0,    0 },
			{ 15, 1.35, 76.27 },
			{ 12, 6.04, 1.48 },
			{ 12, 6.11, 38.13 }
		},
		{ 
			{ 114,  3.142,  0 }
		}
	};


	// Heliocentric latitude.
	private static final double[][][] NEPTUNE_B = {
		{ 
			{ 3088623,  1.4410437,  38.1330356 },
			{ 27789,    5.91272,    76.26607 },
			{ 27624,    0,          0 },
			{ 15448,    3.50877,    39.61751 },
			{ 15355,    2.52124,    36.64856 },
			{ 2000,     1.5100,     74.7816 },
			{ 1968,     4.3778,     1.4845 },
			{ 1015,     3.2156,     35.1641 },
			{ 606,      2.802,      73.297 },
			{ 595,      2.129,      41.102 },
			{ 589,      3.187,      2.969 },
			{ 402,      4.169,      114.399 },
			{ 280,      1.682,      77.751 },
			{ 262,      3.767,      213.299 },
			{ 254,      3.271,      453.425 },
			{ 206,      4.257,      529.691 },
			{ 140,      3.530,      137.033 }
		},
		{ 
			{ 227279, 3.807931, 38.133036 },
			{ 1803,   1.9758,   76.2661 },
			{ 1433,   3.1416,   0 },
			{ 1386,   4.8256,   36.6486 },
			{ 1073,   6.0805,   39.6175 },
			{ 148,    3.858,    74.782 },
			{ 136,    0.478,    1.484 },
			{ 70,     6.19,     35.16 },
			{ 52,     5.05,     73.30 },
			{ 43,     0.31,     114.40 },
			{ 37,     4.89,     41.10 },
			{ 37,     5.76,     2.97 },
			{ 26,     5.22,     213.30 }
		},
		{ 
			{ 9691, 5.5712, 38.1330 },
			{ 79,   3.63,   76.27 },
			{ 72,   0.45,   36.65 },
			{ 59,   3.14,   0 },
			{ 30,   1.61,   39.62 },
			{ 6,    5.61,   74.78 }
		},
		{ 
			{ 273,  1.017,  38.133 },
			{ 2,    0,      0 },
			{ 2,    2.37,   36.65 },
			{ 2,    5.33,   76.27 }
		},
		{ 
			{ 6,  2.67, 38.13 }
		}
	};


	// Heliocentric radius vector.
	private static final double[][][] NEPTUNE_R = {
		{ 
			{ 3007013206.0, 0,          0 },
			{ 27062259,     1.32999459, 38.13303564 },
			{ 1691764,      3.2518614,  36.6485629 },
			{ 807831,       5.185928,   1.484473 },
			{ 537761,       4.521139,   35.164090 },
			{ 495726,       1.571057,   491.557929 },
			{ 274572,       1.845523,   175.166060 },
			{ 135134,       3.372206,   39.617508 },
			{ 121802,       5.797544,   76.266071 },
			{ 100895,       0.377027,   73.297126 },
			{ 69792,        3.79617,    2.96895 },
			{ 46688,        5.74938,    33.67962 },
			{ 24594,        0.50802,    109.94569 },
			{ 16939,        1.59422,    71.81265 },
			{ 14230,        1.07786,    74.78160 },
			{ 12012,        1.92062,    1021.24889 },
			{ 8395,         0.6782,     146.5943 },
			{ 7572,         1.0715,     388.4652 },
			{ 5721,         2.5906,     4.4534 },
			{ 4840,         1.9069,     41.1020 },
			{ 4483,         2.9057,     529.6910 },
			{ 4421,         1.7499,     108.4612 },
			{ 4354,         0.6799,     32.1951 },
			{ 4270,         3.4134,     453.4249 },
			{ 3381,         0.8481,     183.2428 },
			{ 2881,         1.9860,     137.0330 },
			{ 2879,         3.6742,     350.3321 },
			{ 2636,         3.0976,     213.2991 },
			{ 2530,         5.7984,     490.0735 },
			{ 2523,         0.4863,     493.0424 },
			{ 2306,         2.8096,     70.3282 },
			{ 2087,         0.6186,     33.9402 }
		},
		{ 
			{ 236339, 0.704980, 38.133036 },
			{ 13220,  3.32015,  1.48447 },
			{ 8622,   6.2163,   35.1641 },
			{ 2702,   1.8814,   39.6175 },
			{ 2155,   2.0943,   2.9689 },
			{ 2153,   5.1687,   76.2661 },
			{ 1603,   0,        0 },
			{ 1464,   1.1842,   33.6796 },
			{ 1136,   3.9189,   36.6486 },
			{ 898,    5.241,    388.465 },
			{ 790,    0.533,    168.053 },
			{ 760,    0.021,    182.280 },
			{ 607,    1.077,    1021.249 },
			{ 572,    3.401,    484.444 },
			{ 561,    2.887,    498.671 }
		},
		{ 
			{ 4247, 5.8991, 38.1330 },
			{ 218,  0.346,  1.484 },
			{ 163,  2.239,  168.053 },
			{ 156,  4.594,  182.280 },
			{ 127,  2.848,  35.164 }  
		},
		{ 
			{ 166,  4.552,  38.133 }
		}
	};

	/**
	 * Tables of Vsop87 terms for Neptune.
	 */
	static Vsop87 NEPTUNE = new Vsop87(NEPTUNE_L, NEPTUNE_B, NEPTUNE_R);

	
	// ******************************************************************** //
    // Constructor.
    // ******************************************************************** //

	/**
	 * Construct the table of terms for one planet.
	 * 
	 * <p>The constructor is private.  The only way to get instances is
	 * with the static members created for each planet.
	 */
	private Vsop87(double[][][] L, double[][][] B, double[][][] R) {
		this.L = L;
		this.B = B;
		this.R = R;
	}
	
	
	// ******************************************************************** //
    // Computation Methods.
    // ******************************************************************** //

	/**
	 * Calculate the value of L for this body for the given
	 * time.
	 * 
	 * @param	Tm			The time, in Julian millennia elapsed since
	 * 						J2000 in dynamical time.
	 * @return				The calculated value of L in radians.
	 */
	double calculateL(double Tm) {
		return calculateSeries(L, Tm);
	}
	

	/**
	 * Calculate the value of B for this body for the given
	 * time.
	 * 
	 * @param	Tm			The time, in Julian millennia elapsed since
	 * 						J2000 in dynamical time.
	 * @return				The calculated value of B in radians.
	 */
	double calculateB(double Tm) {
		return calculateSeries(B, Tm);
	}
	

	/**
	 * Calculate the value of R for this body for the given
	 * time.
	 * 
	 * @param	Tm			The time, in Julian millennia elapsed since
	 * 						J2000 in dynamical time.
	 * @return				The calculated value of R in AU.
	 */
	double calculateR(double Tm) {
		return calculateSeries(R, Tm);
	}
	
	
	// ******************************************************************** //
    // Utility Methods.
    // ******************************************************************** //

	/**
	 * Calculate the value of an orbital term for a given time.
	 * 
	 * @param	series		The table of periodic terms to calculate over;
	 * 						for example, EarthB.
	 * @param	T			The time, in Julian millennia elapsed since
	 * 						J2000 in dynamical time.
	 * @return				The calculated value.
	 */
	static final double calculateSeries(double[][][] series, double T) {
		int order = series.length;
		
		double Tn = 1;
		double value = 0;
		for (int o = 0; o < order; ++o) {
			double sum = 0;
			for (double[] term : series[o])
				sum += term[0] * cos(term[1] + term[2] * T);
			value += sum * Tn;
			Tn *= T;
		}
		
		// The first column of terms in the table is in units of 1E-8.
		return value  / 100000000;
	}

	
	// ******************************************************************** //
    // Private Data.
    // ******************************************************************** //

	// The tables for L, B and R for this body.
	private double[][][] L;
	private double[][][] B;
	private double[][][] R;
	
}

